sbgECom  1.11.920-stable
sbgEComBinaryLogEkf.h
Go to the documentation of this file.
1 
20 #ifndef __SBG_ECOM_BINARY_LOG_EKF_H__
21 #define __SBG_ECOM_BINARY_LOG_EKF_H__
22 
23 #include <sbgCommon.h>
24 #include <streamBuffer/sbgStreamBuffer.h>
25 
26 //----------------------------------------------------------------------//
27 //- Solution status definitions -//
28 //----------------------------------------------------------------------//
29 
33 #define SBG_ECOM_SOLUTION_MODE_SHIFT (0u)
34 #define SBG_ECOM_SOLUTION_MODE_MASK (0x0000000Fu)
39 #define SBG_ECOM_SOL_ATTITUDE_VALID (0x00000001u << 4)
40 #define SBG_ECOM_SOL_HEADING_VALID (0x00000001u << 5)
41 #define SBG_ECOM_SOL_VELOCITY_VALID (0x00000001u << 6)
42 #define SBG_ECOM_SOL_POSITION_VALID (0x00000001u << 7)
43 #define SBG_ECOM_SOL_VERT_REF_USED (0x00000001u << 8)
44 #define SBG_ECOM_SOL_MAG_REF_USED (0x00000001u << 9)
45 #define SBG_ECOM_SOL_GPS1_VEL_USED (0x00000001u << 10)
46 #define SBG_ECOM_SOL_GPS1_POS_USED (0x00000001u << 11)
47 #define SBG_ECOM_SOL_GPS1_HDT_USED (0x00000001u << 13)
48 #define SBG_ECOM_SOL_GPS2_VEL_USED (0x00000001u << 14)
49 #define SBG_ECOM_SOL_GPS2_POS_USED (0x00000001u << 15)
50 #define SBG_ECOM_SOL_GPS2_HDT_USED (0x00000001u << 17)
51 #define SBG_ECOM_SOL_ODO_USED (0x00000001u << 18)
52 #define SBG_ECOM_SOL_DVL_BT_USED (0x00000001u << 19)
53 #define SBG_ECOM_SOL_DVL_WT_USED (0x00000001u << 20)
54 #define SBG_ECOM_SOL_USER_POS_USED (0x00000001u << 21)
55 #define SBG_ECOM_SOL_USER_VEL_USED (0x00000001u << 22)
56 #define SBG_ECOM_SOL_USER_HEADING_USED (0x00000001u << 23)
57 #define SBG_ECOM_SOL_USBL_USED (0x00000001u << 24)
58 #define SBG_ECOM_SOL_AIR_DATA_USED (0x00000001u << 25)
59 #define SBG_ECOM_SOL_ZUPT_USED (0x00000001u << 26)
60 #define SBG_ECOM_SOL_ALIGN_VALID (0x00000001u << 27)
61 #define SBG_ECOM_SOL_DEPTH_USED (0x00000001u << 28)
66 typedef enum _SbgEComSolutionMode
67 {
74 
75 //----------------------------------------------------------------------//
76 //- Solution status helpers methods -//
77 //----------------------------------------------------------------------//
78 
85 {
87 }
88 
95 SBG_INLINE uint32_t sbgEComLogEkfBuildSolutionStatus(SbgEComSolutionMode solutionMode, uint32_t masks)
96 {
97  //
98  // Create the combined status field
99  //
100  return ((((uint32_t)solutionMode)&SBG_ECOM_SOLUTION_MODE_MASK) << SBG_ECOM_SOLUTION_MODE_SHIFT) | masks;
101 }
102 
103 
104 //----------------------------------------------------------------------//
105 //- Log structure definitions -//
106 //----------------------------------------------------------------------//
107 
111 typedef struct _SbgLogEkfEulerData
112 {
113  uint32_t timeStamp;
114  float euler[3];
115  float eulerStdDev[3];
116  uint32_t status;
118 
122 typedef struct _SbgLogEkfQuatData
123 {
124  uint32_t timeStamp;
125  float quaternion[4];
126  float eulerStdDev[3];
127  uint32_t status;
129 
133 typedef struct _SbgLogEkfNavData
134 {
135  uint32_t timeStamp;
136  float velocity[3];
137  float velocityStdDev[3];
138  double position[3];
140  float undulation;
141  float positionStdDev[3];
142  uint32_t status;
144 
145 //----------------------------------------------------------------------//
146 //- Operations -//
147 //----------------------------------------------------------------------//
148 
155 SbgErrorCode sbgEComBinaryLogParseEkfEulerData(SbgStreamBuffer *pInputStream, SbgLogEkfEulerData *pOutputData);
156 
163 SbgErrorCode sbgEComBinaryLogWriteEkfEulerData(SbgStreamBuffer *pOutputStream, const SbgLogEkfEulerData *pInputData);
164 
171 SbgErrorCode sbgEComBinaryLogParseEkfQuatData(SbgStreamBuffer *pInputStream, SbgLogEkfQuatData *pOutputData);
172 
179 SbgErrorCode sbgEComBinaryLogWriteEkfQuatData(SbgStreamBuffer *pOutputStream, const SbgLogEkfQuatData *pInputData);
180 
187 SbgErrorCode sbgEComBinaryLogParseEkfNavData(SbgStreamBuffer *pInputStream, SbgLogEkfNavData *pOutputData);
188 
195 SbgErrorCode sbgEComBinaryLogWriteEkfNavData(SbgStreamBuffer *pOutputStream, const SbgLogEkfNavData *pInputData);
196 
197 #endif
SBG_INLINE uint32_t sbgEComLogEkfBuildSolutionStatus(SbgEComSolutionMode solutionMode, uint32_t masks)
Definition: sbgEComBinaryLogEkf.h:95
Definition: sbgEComBinaryLogEkf.h:70
struct _SbgLogEkfNavData SbgLogEkfNavData
float undulation
Definition: sbgEComBinaryLogEkf.h:140
struct _SbgLogEkfEulerData SbgLogEkfEulerData
SbgErrorCode sbgEComBinaryLogParseEkfQuatData(SbgStreamBuffer *pInputStream, SbgLogEkfQuatData *pOutputData)
SbgErrorCode sbgEComBinaryLogWriteEkfEulerData(SbgStreamBuffer *pOutputStream, const SbgLogEkfEulerData *pInputData)
Definition: sbgEComBinaryLogEkf.h:69
#define SBG_ECOM_SOLUTION_MODE_MASK
Definition: sbgEComBinaryLogEkf.h:34
uint32_t status
Definition: sbgEComBinaryLogEkf.h:142
SbgErrorCode sbgEComBinaryLogParseEkfNavData(SbgStreamBuffer *pInputStream, SbgLogEkfNavData *pOutputData)
Definition: sbgEComBinaryLogEkf.h:71
uint32_t status
Definition: sbgEComBinaryLogEkf.h:127
enum _SbgEComSolutionMode SbgEComSolutionMode
SBG_INLINE SbgEComSolutionMode sbgEComLogEkfGetSolutionMode(uint32_t status)
Definition: sbgEComBinaryLogEkf.h:84
struct _SbgLogEkfQuatData SbgLogEkfQuatData
Definition: sbgEComBinaryLogEkf.h:68
Definition: sbgEComBinaryLogEkf.h:72
Definition: sbgEComBinaryLogEkf.h:133
uint32_t timeStamp
Definition: sbgEComBinaryLogEkf.h:124
SbgErrorCode sbgEComBinaryLogWriteEkfQuatData(SbgStreamBuffer *pOutputStream, const SbgLogEkfQuatData *pInputData)
float euler[3]
Definition: sbgEComBinaryLogEkf.h:114
Definition: sbgEComBinaryLogEkf.h:122
float eulerStdDev[3]
Definition: sbgEComBinaryLogEkf.h:115
uint32_t status
Definition: sbgEComBinaryLogEkf.h:116
SbgErrorCode sbgEComBinaryLogWriteEkfNavData(SbgStreamBuffer *pOutputStream, const SbgLogEkfNavData *pInputData)
SbgErrorCode sbgEComBinaryLogParseEkfEulerData(SbgStreamBuffer *pInputStream, SbgLogEkfEulerData *pOutputData)
uint32_t timeStamp
Definition: sbgEComBinaryLogEkf.h:113
#define SBG_ECOM_SOLUTION_MODE_SHIFT
Definition: sbgEComBinaryLogEkf.h:33
Definition: sbgEComBinaryLogEkf.h:111
uint32_t timeStamp
Definition: sbgEComBinaryLogEkf.h:135