{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# LANGUAGE NoImplicitPrelude           #-}
{-# LANGUAGE TemplateHaskell             #-}
{-# LANGUAGE RecordWildCards             #-}

-- |
-- Module:      SwiftNav.SBP.Orientation
-- Copyright:   Copyright (C) 2015-2021 Swift Navigation, Inc.
-- License:     MIT
-- Contact:     https://support.swiftnav.com
-- Stability:   experimental
-- Portability: portable
--
-- \< Orientation Messages \>

module SwiftNav.SBP.Orientation
  ( module SwiftNav.SBP.Orientation
  ) where

import BasicPrelude
import Control.Lens
import Control.Monad.Loops
import Data.Binary
import Data.Binary.Get
import Data.Binary.IEEE754
import Data.Binary.Put
import Data.ByteString.Lazy    hiding (ByteString)
import Data.Int
import Data.Word
import SwiftNav.SBP.TH

{-# ANN module ("HLint: ignore Use camelCase"::String) #-}
{-# ANN module ("HLint: ignore Redundant do"::String) #-}
{-# ANN module ("HLint: ignore Use newtype instead of data"::String) #-}


msgBaselineHeading :: Word16
msgBaselineHeading :: Word16
msgBaselineHeading = Word16
0x020F

-- | SBP class for message MSG_BASELINE_HEADING (0x020F).
--
-- This message reports the baseline heading pointing from the base station to
-- the rover relative to True North. The full GPS time is given by the
-- preceding MSG_GPS_TIME with the matching time-of-week (tow). It is intended
-- that time-matched RTK mode is used when the base station is moving.
data MsgBaselineHeading = MsgBaselineHeading
  { MsgBaselineHeading -> Word32
_msgBaselineHeading_tow   :: !Word32
    -- ^ GPS Time of Week
  , MsgBaselineHeading -> Word32
_msgBaselineHeading_heading :: !Word32
    -- ^ Heading
  , MsgBaselineHeading -> Word8
_msgBaselineHeading_n_sats :: !Word8
    -- ^ Number of satellites used in solution
  , MsgBaselineHeading -> Word8
_msgBaselineHeading_flags :: !Word8
    -- ^ Status flags
  } deriving ( Int -> MsgBaselineHeading -> ShowS
[MsgBaselineHeading] -> ShowS
MsgBaselineHeading -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgBaselineHeading] -> ShowS
$cshowList :: [MsgBaselineHeading] -> ShowS
show :: MsgBaselineHeading -> String
$cshow :: MsgBaselineHeading -> String
showsPrec :: Int -> MsgBaselineHeading -> ShowS
$cshowsPrec :: Int -> MsgBaselineHeading -> ShowS
Show, ReadPrec [MsgBaselineHeading]
ReadPrec MsgBaselineHeading
Int -> ReadS MsgBaselineHeading
ReadS [MsgBaselineHeading]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgBaselineHeading]
$creadListPrec :: ReadPrec [MsgBaselineHeading]
readPrec :: ReadPrec MsgBaselineHeading
$creadPrec :: ReadPrec MsgBaselineHeading
readList :: ReadS [MsgBaselineHeading]
$creadList :: ReadS [MsgBaselineHeading]
readsPrec :: Int -> ReadS MsgBaselineHeading
$creadsPrec :: Int -> ReadS MsgBaselineHeading
Read, MsgBaselineHeading -> MsgBaselineHeading -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgBaselineHeading -> MsgBaselineHeading -> Bool
$c/= :: MsgBaselineHeading -> MsgBaselineHeading -> Bool
== :: MsgBaselineHeading -> MsgBaselineHeading -> Bool
$c== :: MsgBaselineHeading -> MsgBaselineHeading -> Bool
Eq )

instance Binary MsgBaselineHeading where
  get :: Get MsgBaselineHeading
get = do
    Word32
_msgBaselineHeading_tow <- Get Word32
getWord32le
    Word32
_msgBaselineHeading_heading <- Get Word32
getWord32le
    Word8
_msgBaselineHeading_n_sats <- Get Word8
getWord8
    Word8
_msgBaselineHeading_flags <- Get Word8
getWord8
    forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgBaselineHeading {Word8
Word32
_msgBaselineHeading_flags :: Word8
_msgBaselineHeading_n_sats :: Word8
_msgBaselineHeading_heading :: Word32
_msgBaselineHeading_tow :: Word32
_msgBaselineHeading_flags :: Word8
_msgBaselineHeading_n_sats :: Word8
_msgBaselineHeading_heading :: Word32
_msgBaselineHeading_tow :: Word32
..}

  put :: MsgBaselineHeading -> Put
put MsgBaselineHeading {Word8
Word32
_msgBaselineHeading_flags :: Word8
_msgBaselineHeading_n_sats :: Word8
_msgBaselineHeading_heading :: Word32
_msgBaselineHeading_tow :: Word32
_msgBaselineHeading_flags :: MsgBaselineHeading -> Word8
_msgBaselineHeading_n_sats :: MsgBaselineHeading -> Word8
_msgBaselineHeading_heading :: MsgBaselineHeading -> Word32
_msgBaselineHeading_tow :: MsgBaselineHeading -> Word32
..} = do
    Word32 -> Put
putWord32le Word32
_msgBaselineHeading_tow
    Word32 -> Put
putWord32le Word32
_msgBaselineHeading_heading
    Word8 -> Put
putWord8 Word8
_msgBaselineHeading_n_sats
    Word8 -> Put
putWord8 Word8
_msgBaselineHeading_flags

$(makeSBP 'msgBaselineHeading ''MsgBaselineHeading)
$(makeJSON "_msgBaselineHeading_" ''MsgBaselineHeading)
$(makeLenses ''MsgBaselineHeading)

msgOrientQuat :: Word16
msgOrientQuat :: Word16
msgOrientQuat = Word16
0x0220

-- | SBP class for message MSG_ORIENT_QUAT (0x0220).
--
-- This message reports the quaternion vector describing the vehicle body
-- frame's orientation with respect to a local-level NED frame. The components
-- of the vector should sum to a unit vector assuming that the LSB of each
-- component as a value of 2^-31. This message will only be available in
-- future INS versions of Swift Products and is not produced by Piksi Multi or
-- Duro.
data MsgOrientQuat = MsgOrientQuat
  { MsgOrientQuat -> Word32
_msgOrientQuat_tow      :: !Word32
    -- ^ GPS Time of Week
  , MsgOrientQuat -> Int32
_msgOrientQuat_w        :: !Int32
    -- ^ Real component
  , MsgOrientQuat -> Int32
_msgOrientQuat_x        :: !Int32
    -- ^ 1st imaginary component
  , MsgOrientQuat -> Int32
_msgOrientQuat_y        :: !Int32
    -- ^ 2nd imaginary component
  , MsgOrientQuat -> Int32
_msgOrientQuat_z        :: !Int32
    -- ^ 3rd imaginary component
  , MsgOrientQuat -> Float
_msgOrientQuat_w_accuracy :: !Float
    -- ^ Estimated standard deviation of w
  , MsgOrientQuat -> Float
_msgOrientQuat_x_accuracy :: !Float
    -- ^ Estimated standard deviation of x
  , MsgOrientQuat -> Float
_msgOrientQuat_y_accuracy :: !Float
    -- ^ Estimated standard deviation of y
  , MsgOrientQuat -> Float
_msgOrientQuat_z_accuracy :: !Float
    -- ^ Estimated standard deviation of z
  , MsgOrientQuat -> Word8
_msgOrientQuat_flags    :: !Word8
    -- ^ Status flags
  } deriving ( Int -> MsgOrientQuat -> ShowS
[MsgOrientQuat] -> ShowS
MsgOrientQuat -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgOrientQuat] -> ShowS
$cshowList :: [MsgOrientQuat] -> ShowS
show :: MsgOrientQuat -> String
$cshow :: MsgOrientQuat -> String
showsPrec :: Int -> MsgOrientQuat -> ShowS
$cshowsPrec :: Int -> MsgOrientQuat -> ShowS
Show, ReadPrec [MsgOrientQuat]
ReadPrec MsgOrientQuat
Int -> ReadS MsgOrientQuat
ReadS [MsgOrientQuat]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgOrientQuat]
$creadListPrec :: ReadPrec [MsgOrientQuat]
readPrec :: ReadPrec MsgOrientQuat
$creadPrec :: ReadPrec MsgOrientQuat
readList :: ReadS [MsgOrientQuat]
$creadList :: ReadS [MsgOrientQuat]
readsPrec :: Int -> ReadS MsgOrientQuat
$creadsPrec :: Int -> ReadS MsgOrientQuat
Read, MsgOrientQuat -> MsgOrientQuat -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgOrientQuat -> MsgOrientQuat -> Bool
$c/= :: MsgOrientQuat -> MsgOrientQuat -> Bool
== :: MsgOrientQuat -> MsgOrientQuat -> Bool
$c== :: MsgOrientQuat -> MsgOrientQuat -> Bool
Eq )

instance Binary MsgOrientQuat where
  get :: Get MsgOrientQuat
get = do
    Word32
_msgOrientQuat_tow <- Get Word32
getWord32le
    Int32
_msgOrientQuat_w <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Int32
_msgOrientQuat_x <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Int32
_msgOrientQuat_y <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Int32
_msgOrientQuat_z <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Float
_msgOrientQuat_w_accuracy <- Get Float
getFloat32le
    Float
_msgOrientQuat_x_accuracy <- Get Float
getFloat32le
    Float
_msgOrientQuat_y_accuracy <- Get Float
getFloat32le
    Float
_msgOrientQuat_z_accuracy <- Get Float
getFloat32le
    Word8
_msgOrientQuat_flags <- Get Word8
getWord8
    forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgOrientQuat {Float
Int32
Word8
Word32
_msgOrientQuat_flags :: Word8
_msgOrientQuat_z_accuracy :: Float
_msgOrientQuat_y_accuracy :: Float
_msgOrientQuat_x_accuracy :: Float
_msgOrientQuat_w_accuracy :: Float
_msgOrientQuat_z :: Int32
_msgOrientQuat_y :: Int32
_msgOrientQuat_x :: Int32
_msgOrientQuat_w :: Int32
_msgOrientQuat_tow :: Word32
_msgOrientQuat_flags :: Word8
_msgOrientQuat_z_accuracy :: Float
_msgOrientQuat_y_accuracy :: Float
_msgOrientQuat_x_accuracy :: Float
_msgOrientQuat_w_accuracy :: Float
_msgOrientQuat_z :: Int32
_msgOrientQuat_y :: Int32
_msgOrientQuat_x :: Int32
_msgOrientQuat_w :: Int32
_msgOrientQuat_tow :: Word32
..}

  put :: MsgOrientQuat -> Put
put MsgOrientQuat {Float
Int32
Word8
Word32
_msgOrientQuat_flags :: Word8
_msgOrientQuat_z_accuracy :: Float
_msgOrientQuat_y_accuracy :: Float
_msgOrientQuat_x_accuracy :: Float
_msgOrientQuat_w_accuracy :: Float
_msgOrientQuat_z :: Int32
_msgOrientQuat_y :: Int32
_msgOrientQuat_x :: Int32
_msgOrientQuat_w :: Int32
_msgOrientQuat_tow :: Word32
_msgOrientQuat_flags :: MsgOrientQuat -> Word8
_msgOrientQuat_z_accuracy :: MsgOrientQuat -> Float
_msgOrientQuat_y_accuracy :: MsgOrientQuat -> Float
_msgOrientQuat_x_accuracy :: MsgOrientQuat -> Float
_msgOrientQuat_w_accuracy :: MsgOrientQuat -> Float
_msgOrientQuat_z :: MsgOrientQuat -> Int32
_msgOrientQuat_y :: MsgOrientQuat -> Int32
_msgOrientQuat_x :: MsgOrientQuat -> Int32
_msgOrientQuat_w :: MsgOrientQuat -> Int32
_msgOrientQuat_tow :: MsgOrientQuat -> Word32
..} = do
    Word32 -> Put
putWord32le Word32
_msgOrientQuat_tow
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientQuat_w
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientQuat_x
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientQuat_y
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientQuat_z
    Float -> Put
putFloat32le Float
_msgOrientQuat_w_accuracy
    Float -> Put
putFloat32le Float
_msgOrientQuat_x_accuracy
    Float -> Put
putFloat32le Float
_msgOrientQuat_y_accuracy
    Float -> Put
putFloat32le Float
_msgOrientQuat_z_accuracy
    Word8 -> Put
putWord8 Word8
_msgOrientQuat_flags

$(makeSBP 'msgOrientQuat ''MsgOrientQuat)
$(makeJSON "_msgOrientQuat_" ''MsgOrientQuat)
$(makeLenses ''MsgOrientQuat)

msgOrientEuler :: Word16
msgOrientEuler :: Word16
msgOrientEuler = Word16
0x0221

-- | SBP class for message MSG_ORIENT_EULER (0x0221).
--
-- This message reports the yaw, pitch, and roll angles of the vehicle body
-- frame. The rotations should applied intrinsically in the order yaw, pitch,
-- and roll in order to rotate the from a frame aligned with the local-level
-- NED frame to the vehicle body frame.  This message will only be available
-- in future INS versions of Swift Products and is not produced by Piksi Multi
-- or Duro.
data MsgOrientEuler = MsgOrientEuler
  { MsgOrientEuler -> Word32
_msgOrientEuler_tow          :: !Word32
    -- ^ GPS Time of Week
  , MsgOrientEuler -> Int32
_msgOrientEuler_roll         :: !Int32
    -- ^ rotation about the forward axis of the vehicle
  , MsgOrientEuler -> Int32
_msgOrientEuler_pitch        :: !Int32
    -- ^ rotation about the rightward axis of the vehicle
  , MsgOrientEuler -> Int32
_msgOrientEuler_yaw          :: !Int32
    -- ^ rotation about the downward axis of the vehicle
  , MsgOrientEuler -> Float
_msgOrientEuler_roll_accuracy :: !Float
    -- ^ Estimated standard deviation of roll
  , MsgOrientEuler -> Float
_msgOrientEuler_pitch_accuracy :: !Float
    -- ^ Estimated standard deviation of pitch
  , MsgOrientEuler -> Float
_msgOrientEuler_yaw_accuracy :: !Float
    -- ^ Estimated standard deviation of yaw
  , MsgOrientEuler -> Word8
_msgOrientEuler_flags        :: !Word8
    -- ^ Status flags
  } deriving ( Int -> MsgOrientEuler -> ShowS
[MsgOrientEuler] -> ShowS
MsgOrientEuler -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgOrientEuler] -> ShowS
$cshowList :: [MsgOrientEuler] -> ShowS
show :: MsgOrientEuler -> String
$cshow :: MsgOrientEuler -> String
showsPrec :: Int -> MsgOrientEuler -> ShowS
$cshowsPrec :: Int -> MsgOrientEuler -> ShowS
Show, ReadPrec [MsgOrientEuler]
ReadPrec MsgOrientEuler
Int -> ReadS MsgOrientEuler
ReadS [MsgOrientEuler]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgOrientEuler]
$creadListPrec :: ReadPrec [MsgOrientEuler]
readPrec :: ReadPrec MsgOrientEuler
$creadPrec :: ReadPrec MsgOrientEuler
readList :: ReadS [MsgOrientEuler]
$creadList :: ReadS [MsgOrientEuler]
readsPrec :: Int -> ReadS MsgOrientEuler
$creadsPrec :: Int -> ReadS MsgOrientEuler
Read, MsgOrientEuler -> MsgOrientEuler -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgOrientEuler -> MsgOrientEuler -> Bool
$c/= :: MsgOrientEuler -> MsgOrientEuler -> Bool
== :: MsgOrientEuler -> MsgOrientEuler -> Bool
$c== :: MsgOrientEuler -> MsgOrientEuler -> Bool
Eq )

instance Binary MsgOrientEuler where
  get :: Get MsgOrientEuler
get = do
    Word32
_msgOrientEuler_tow <- Get Word32
getWord32le
    Int32
_msgOrientEuler_roll <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Int32
_msgOrientEuler_pitch <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Int32
_msgOrientEuler_yaw <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Float
_msgOrientEuler_roll_accuracy <- Get Float
getFloat32le
    Float
_msgOrientEuler_pitch_accuracy <- Get Float
getFloat32le
    Float
_msgOrientEuler_yaw_accuracy <- Get Float
getFloat32le
    Word8
_msgOrientEuler_flags <- Get Word8
getWord8
    forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgOrientEuler {Float
Int32
Word8
Word32
_msgOrientEuler_flags :: Word8
_msgOrientEuler_yaw_accuracy :: Float
_msgOrientEuler_pitch_accuracy :: Float
_msgOrientEuler_roll_accuracy :: Float
_msgOrientEuler_yaw :: Int32
_msgOrientEuler_pitch :: Int32
_msgOrientEuler_roll :: Int32
_msgOrientEuler_tow :: Word32
_msgOrientEuler_flags :: Word8
_msgOrientEuler_yaw_accuracy :: Float
_msgOrientEuler_pitch_accuracy :: Float
_msgOrientEuler_roll_accuracy :: Float
_msgOrientEuler_yaw :: Int32
_msgOrientEuler_pitch :: Int32
_msgOrientEuler_roll :: Int32
_msgOrientEuler_tow :: Word32
..}

  put :: MsgOrientEuler -> Put
put MsgOrientEuler {Float
Int32
Word8
Word32
_msgOrientEuler_flags :: Word8
_msgOrientEuler_yaw_accuracy :: Float
_msgOrientEuler_pitch_accuracy :: Float
_msgOrientEuler_roll_accuracy :: Float
_msgOrientEuler_yaw :: Int32
_msgOrientEuler_pitch :: Int32
_msgOrientEuler_roll :: Int32
_msgOrientEuler_tow :: Word32
_msgOrientEuler_flags :: MsgOrientEuler -> Word8
_msgOrientEuler_yaw_accuracy :: MsgOrientEuler -> Float
_msgOrientEuler_pitch_accuracy :: MsgOrientEuler -> Float
_msgOrientEuler_roll_accuracy :: MsgOrientEuler -> Float
_msgOrientEuler_yaw :: MsgOrientEuler -> Int32
_msgOrientEuler_pitch :: MsgOrientEuler -> Int32
_msgOrientEuler_roll :: MsgOrientEuler -> Int32
_msgOrientEuler_tow :: MsgOrientEuler -> Word32
..} = do
    Word32 -> Put
putWord32le Word32
_msgOrientEuler_tow
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientEuler_roll
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientEuler_pitch
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientEuler_yaw
    Float -> Put
putFloat32le Float
_msgOrientEuler_roll_accuracy
    Float -> Put
putFloat32le Float
_msgOrientEuler_pitch_accuracy
    Float -> Put
putFloat32le Float
_msgOrientEuler_yaw_accuracy
    Word8 -> Put
putWord8 Word8
_msgOrientEuler_flags

$(makeSBP 'msgOrientEuler ''MsgOrientEuler)
$(makeJSON "_msgOrientEuler_" ''MsgOrientEuler)
$(makeLenses ''MsgOrientEuler)

msgAngularRate :: Word16
msgAngularRate :: Word16
msgAngularRate = Word16
0x0222

-- | SBP class for message MSG_ANGULAR_RATE (0x0222).
--
-- This message reports the orientation rates in the vehicle body frame. The
-- values represent the measurements a strapped down gyroscope would make and
-- are not equivalent to the time derivative of the Euler angles. The
-- orientation and origin of the user frame is specified via device settings.
-- By convention, the vehicle x-axis is expected to be aligned with the
-- forward direction, while the vehicle y-axis is expected to be aligned with
-- the right direction, and the vehicle z-axis should be aligned with the down
-- direction. This message will only be available in future INS versions of
-- Swift Products and is not produced by Piksi Multi or Duro.
data MsgAngularRate = MsgAngularRate
  { MsgAngularRate -> Word32
_msgAngularRate_tow :: !Word32
    -- ^ GPS Time of Week
  , MsgAngularRate -> Int32
_msgAngularRate_x   :: !Int32
    -- ^ angular rate about x axis
  , MsgAngularRate -> Int32
_msgAngularRate_y   :: !Int32
    -- ^ angular rate about y axis
  , MsgAngularRate -> Int32
_msgAngularRate_z   :: !Int32
    -- ^ angular rate about z axis
  , MsgAngularRate -> Word8
_msgAngularRate_flags :: !Word8
    -- ^ Status flags
  } deriving ( Int -> MsgAngularRate -> ShowS
[MsgAngularRate] -> ShowS
MsgAngularRate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgAngularRate] -> ShowS
$cshowList :: [MsgAngularRate] -> ShowS
show :: MsgAngularRate -> String
$cshow :: MsgAngularRate -> String
showsPrec :: Int -> MsgAngularRate -> ShowS
$cshowsPrec :: Int -> MsgAngularRate -> ShowS
Show, ReadPrec [MsgAngularRate]
ReadPrec MsgAngularRate
Int -> ReadS MsgAngularRate
ReadS [MsgAngularRate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgAngularRate]
$creadListPrec :: ReadPrec [MsgAngularRate]
readPrec :: ReadPrec MsgAngularRate
$creadPrec :: ReadPrec MsgAngularRate
readList :: ReadS [MsgAngularRate]
$creadList :: ReadS [MsgAngularRate]
readsPrec :: Int -> ReadS MsgAngularRate
$creadsPrec :: Int -> ReadS MsgAngularRate
Read, MsgAngularRate -> MsgAngularRate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgAngularRate -> MsgAngularRate -> Bool
$c/= :: MsgAngularRate -> MsgAngularRate -> Bool
== :: MsgAngularRate -> MsgAngularRate -> Bool
$c== :: MsgAngularRate -> MsgAngularRate -> Bool
Eq )

instance Binary MsgAngularRate where
  get :: Get MsgAngularRate
get = do
    Word32
_msgAngularRate_tow <- Get Word32
getWord32le
    Int32
_msgAngularRate_x <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Int32
_msgAngularRate_y <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Int32
_msgAngularRate_z <- (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
    Word8
_msgAngularRate_flags <- Get Word8
getWord8
    forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgAngularRate {Int32
Word8
Word32
_msgAngularRate_flags :: Word8
_msgAngularRate_z :: Int32
_msgAngularRate_y :: Int32
_msgAngularRate_x :: Int32
_msgAngularRate_tow :: Word32
_msgAngularRate_flags :: Word8
_msgAngularRate_z :: Int32
_msgAngularRate_y :: Int32
_msgAngularRate_x :: Int32
_msgAngularRate_tow :: Word32
..}

  put :: MsgAngularRate -> Put
put MsgAngularRate {Int32
Word8
Word32
_msgAngularRate_flags :: Word8
_msgAngularRate_z :: Int32
_msgAngularRate_y :: Int32
_msgAngularRate_x :: Int32
_msgAngularRate_tow :: Word32
_msgAngularRate_flags :: MsgAngularRate -> Word8
_msgAngularRate_z :: MsgAngularRate -> Int32
_msgAngularRate_y :: MsgAngularRate -> Int32
_msgAngularRate_x :: MsgAngularRate -> Int32
_msgAngularRate_tow :: MsgAngularRate -> Word32
..} = do
    Word32 -> Put
putWord32le Word32
_msgAngularRate_tow
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgAngularRate_x
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgAngularRate_y
    (Word32 -> Put
putWord32le forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgAngularRate_z
    Word8 -> Put
putWord8 Word8
_msgAngularRate_flags

$(makeSBP 'msgAngularRate ''MsgAngularRate)
$(makeJSON "_msgAngularRate_" ''MsgAngularRate)
$(makeLenses ''MsgAngularRate)