{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RecordWildCards #-}
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
data MsgBaselineHeading = MsgBaselineHeading
{ MsgBaselineHeading -> Word32
_msgBaselineHeading_tow :: !Word32
, MsgBaselineHeading -> Word32
_msgBaselineHeading_heading :: !Word32
, MsgBaselineHeading -> Word8
_msgBaselineHeading_n_sats :: !Word8
, MsgBaselineHeading -> Word8
_msgBaselineHeading_flags :: !Word8
} deriving ( Int -> MsgBaselineHeading -> ShowS
[MsgBaselineHeading] -> ShowS
MsgBaselineHeading -> String
(Int -> MsgBaselineHeading -> ShowS)
-> (MsgBaselineHeading -> String)
-> ([MsgBaselineHeading] -> ShowS)
-> Show MsgBaselineHeading
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]
(Int -> ReadS MsgBaselineHeading)
-> ReadS [MsgBaselineHeading]
-> ReadPrec MsgBaselineHeading
-> ReadPrec [MsgBaselineHeading]
-> Read 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
(MsgBaselineHeading -> MsgBaselineHeading -> Bool)
-> (MsgBaselineHeading -> MsgBaselineHeading -> Bool)
-> Eq MsgBaselineHeading
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
MsgBaselineHeading -> Get MsgBaselineHeading
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgBaselineHeading :: Word32 -> Word32 -> Word8 -> Word8 -> MsgBaselineHeading
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
data MsgOrientQuat = MsgOrientQuat
{ MsgOrientQuat -> Word32
_msgOrientQuat_tow :: !Word32
, MsgOrientQuat -> Int32
_msgOrientQuat_w :: !Int32
, MsgOrientQuat -> Int32
_msgOrientQuat_x :: !Int32
, MsgOrientQuat -> Int32
_msgOrientQuat_y :: !Int32
, MsgOrientQuat -> Int32
_msgOrientQuat_z :: !Int32
, MsgOrientQuat -> Float
_msgOrientQuat_w_accuracy :: !Float
, MsgOrientQuat -> Float
_msgOrientQuat_x_accuracy :: !Float
, MsgOrientQuat -> Float
_msgOrientQuat_y_accuracy :: !Float
, MsgOrientQuat -> Float
_msgOrientQuat_z_accuracy :: !Float
, MsgOrientQuat -> Word8
_msgOrientQuat_flags :: !Word8
} deriving ( Int -> MsgOrientQuat -> ShowS
[MsgOrientQuat] -> ShowS
MsgOrientQuat -> String
(Int -> MsgOrientQuat -> ShowS)
-> (MsgOrientQuat -> String)
-> ([MsgOrientQuat] -> ShowS)
-> Show MsgOrientQuat
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]
(Int -> ReadS MsgOrientQuat)
-> ReadS [MsgOrientQuat]
-> ReadPrec MsgOrientQuat
-> ReadPrec [MsgOrientQuat]
-> Read 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
(MsgOrientQuat -> MsgOrientQuat -> Bool)
-> (MsgOrientQuat -> MsgOrientQuat -> Bool) -> Eq MsgOrientQuat
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 <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
Int32
_msgOrientQuat_x <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
Int32
_msgOrientQuat_y <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
Int32
_msgOrientQuat_z <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
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
MsgOrientQuat -> Get MsgOrientQuat
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgOrientQuat :: Word32
-> Int32
-> Int32
-> Int32
-> Int32
-> Float
-> Float
-> Float
-> Float
-> Word8
-> MsgOrientQuat
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 (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientQuat_w
(Word32 -> Put
putWord32le (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientQuat_x
(Word32 -> Put
putWord32le (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientQuat_y
(Word32 -> Put
putWord32le (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
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
data MsgOrientEuler = MsgOrientEuler
{ MsgOrientEuler -> Word32
_msgOrientEuler_tow :: !Word32
, MsgOrientEuler -> Int32
_msgOrientEuler_roll :: !Int32
, MsgOrientEuler -> Int32
_msgOrientEuler_pitch :: !Int32
, MsgOrientEuler -> Int32
_msgOrientEuler_yaw :: !Int32
, MsgOrientEuler -> Float
_msgOrientEuler_roll_accuracy :: !Float
, MsgOrientEuler -> Float
_msgOrientEuler_pitch_accuracy :: !Float
, MsgOrientEuler -> Float
_msgOrientEuler_yaw_accuracy :: !Float
, MsgOrientEuler -> Word8
_msgOrientEuler_flags :: !Word8
} deriving ( Int -> MsgOrientEuler -> ShowS
[MsgOrientEuler] -> ShowS
MsgOrientEuler -> String
(Int -> MsgOrientEuler -> ShowS)
-> (MsgOrientEuler -> String)
-> ([MsgOrientEuler] -> ShowS)
-> Show MsgOrientEuler
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]
(Int -> ReadS MsgOrientEuler)
-> ReadS [MsgOrientEuler]
-> ReadPrec MsgOrientEuler
-> ReadPrec [MsgOrientEuler]
-> Read 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
(MsgOrientEuler -> MsgOrientEuler -> Bool)
-> (MsgOrientEuler -> MsgOrientEuler -> Bool) -> Eq MsgOrientEuler
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 <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
Int32
_msgOrientEuler_pitch <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
Int32
_msgOrientEuler_yaw <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
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
MsgOrientEuler -> Get MsgOrientEuler
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgOrientEuler :: Word32
-> Int32
-> Int32
-> Int32
-> Float
-> Float
-> Float
-> Word8
-> MsgOrientEuler
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 (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientEuler_roll
(Word32 -> Put
putWord32le (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgOrientEuler_pitch
(Word32 -> Put
putWord32le (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
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
data MsgAngularRate = MsgAngularRate
{ MsgAngularRate -> Word32
_msgAngularRate_tow :: !Word32
, MsgAngularRate -> Int32
_msgAngularRate_x :: !Int32
, MsgAngularRate -> Int32
_msgAngularRate_y :: !Int32
, MsgAngularRate -> Int32
_msgAngularRate_z :: !Int32
, MsgAngularRate -> Word8
_msgAngularRate_flags :: !Word8
} deriving ( Int -> MsgAngularRate -> ShowS
[MsgAngularRate] -> ShowS
MsgAngularRate -> String
(Int -> MsgAngularRate -> ShowS)
-> (MsgAngularRate -> String)
-> ([MsgAngularRate] -> ShowS)
-> Show MsgAngularRate
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]
(Int -> ReadS MsgAngularRate)
-> ReadS [MsgAngularRate]
-> ReadPrec MsgAngularRate
-> ReadPrec [MsgAngularRate]
-> Read 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
(MsgAngularRate -> MsgAngularRate -> Bool)
-> (MsgAngularRate -> MsgAngularRate -> Bool) -> Eq MsgAngularRate
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 <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
Int32
_msgAngularRate_y <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
Int32
_msgAngularRate_z <- (Word32 -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32 -> Int32) -> Get Word32 -> Get Int32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word32
getWord32le)
Word8
_msgAngularRate_flags <- Get Word8
getWord8
MsgAngularRate -> Get MsgAngularRate
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgAngularRate :: Word32 -> Int32 -> Int32 -> Int32 -> Word8 -> MsgAngularRate
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 (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgAngularRate_x
(Word32 -> Put
putWord32le (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral) Int32
_msgAngularRate_y
(Word32 -> Put
putWord32le (Word32 -> Put) -> (Int32 -> Word32) -> Int32 -> Put
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Int32 -> Word32
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)