sbgEComBinaryLogEkf.c
Go to the documentation of this file.
1 #include "sbgEComBinaryLogEkf.h"
2 
3 //----------------------------------------------------------------------//
4 //- Operations -//
5 //----------------------------------------------------------------------//
6 
14 {
15  assert(pInputStream);
16  assert(pOutputData);
17 
18  //
19  // Read the frame payload
20  //
21  pOutputData->timeStamp = sbgStreamBufferReadUint32LE(pInputStream);
22 
23  pOutputData->euler[0] = sbgStreamBufferReadFloatLE(pInputStream);
24  pOutputData->euler[1] = sbgStreamBufferReadFloatLE(pInputStream);
25  pOutputData->euler[2] = sbgStreamBufferReadFloatLE(pInputStream);
26 
27  pOutputData->eulerStdDev[0] = sbgStreamBufferReadFloatLE(pInputStream);
28  pOutputData->eulerStdDev[1] = sbgStreamBufferReadFloatLE(pInputStream);
29  pOutputData->eulerStdDev[2] = sbgStreamBufferReadFloatLE(pInputStream);
30 
31  pOutputData->status = sbgStreamBufferReadUint32LE(pInputStream);
32 
33  //
34  // Return if any error has occurred while parsing the frame
35  //
36  return sbgStreamBufferGetLastError(pInputStream);
37 }
38 
46 {
47  assert(pOutputStream);
48  assert(pInputData);
49 
50  //
51  // Write the frame payload
52  //
53  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
54 
55  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->euler[0]);
56  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->euler[1]);
57  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->euler[2]);
58 
59  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[0]);
60  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[1]);
61  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[2]);
62 
63  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->status);
64 
65  //
66  // Return if any error has occurred while writing the frame
67  //
68  return sbgStreamBufferGetLastError(pOutputStream);
69 }
70 
78 {
79  assert(pInputStream);
80  assert(pOutputData);
81 
82  //
83  // Read the frame payload
84  //
85  pOutputData->timeStamp = sbgStreamBufferReadUint32LE(pInputStream);
86 
87  pOutputData->quaternion[0] = sbgStreamBufferReadFloatLE(pInputStream);
88  pOutputData->quaternion[1] = sbgStreamBufferReadFloatLE(pInputStream);
89  pOutputData->quaternion[2] = sbgStreamBufferReadFloatLE(pInputStream);
90  pOutputData->quaternion[3] = sbgStreamBufferReadFloatLE(pInputStream);
91 
92  pOutputData->eulerStdDev[0] = sbgStreamBufferReadFloatLE(pInputStream);
93  pOutputData->eulerStdDev[1] = sbgStreamBufferReadFloatLE(pInputStream);
94  pOutputData->eulerStdDev[2] = sbgStreamBufferReadFloatLE(pInputStream);
95 
96  pOutputData->status = sbgStreamBufferReadUint32LE(pInputStream);
97 
98  //
99  // Return if any error has occurred while parsing the frame
100  //
101  return sbgStreamBufferGetLastError(pInputStream);
102 }
103 
111 {
112  assert(pOutputStream);
113  assert(pInputData);
114 
115  //
116  // Write the frame payload
117  //
118  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
119 
120  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->quaternion[0]);
121  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->quaternion[1]);
122  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->quaternion[2]);
123  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->quaternion[3]);
124 
125  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[0]);
126  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[1]);
127  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[2]);
128 
129  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->status);
130 
131  //
132  // Return if any error has occurred while writing the frame
133  //
134  return sbgStreamBufferGetLastError(pOutputStream);
135 }
136 
144 {
145  assert(pInputStream);
146  assert(pOutputData);
147 
148  //
149  // Read the frame payload
150  //
151  pOutputData->timeStamp = sbgStreamBufferReadUint32LE(pInputStream);
152 
153  pOutputData->velocity[0] = sbgStreamBufferReadFloatLE(pInputStream);
154  pOutputData->velocity[1] = sbgStreamBufferReadFloatLE(pInputStream);
155  pOutputData->velocity[2] = sbgStreamBufferReadFloatLE(pInputStream);
156 
157  pOutputData->velocityStdDev[0] = sbgStreamBufferReadFloatLE(pInputStream);
158  pOutputData->velocityStdDev[1] = sbgStreamBufferReadFloatLE(pInputStream);
159  pOutputData->velocityStdDev[2] = sbgStreamBufferReadFloatLE(pInputStream);
160 
161  pOutputData->position[0] = sbgStreamBufferReadDoubleLE(pInputStream);
162  pOutputData->position[1] = sbgStreamBufferReadDoubleLE(pInputStream);
163  pOutputData->position[2] = sbgStreamBufferReadDoubleLE(pInputStream);
164 
165  pOutputData->undulation = sbgStreamBufferReadFloatLE(pInputStream);
166 
167  pOutputData->positionStdDev[0] = sbgStreamBufferReadFloatLE(pInputStream);
168  pOutputData->positionStdDev[1] = sbgStreamBufferReadFloatLE(pInputStream);
169  pOutputData->positionStdDev[2] = sbgStreamBufferReadFloatLE(pInputStream);
170 
171  pOutputData->status = sbgStreamBufferReadUint32LE(pInputStream);
172 
173  //
174  // Return if any error has occurred while parsing the frame
175  //
176  return sbgStreamBufferGetLastError(pInputStream);
177 }
178 
186 {
187  assert(pOutputStream);
188  assert(pInputData);
189 
190  //
191  // Write the frame payload
192  //
193  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
194 
195  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[0]);
196  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[1]);
197  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[2]);
198 
199  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityStdDev[0]);
200  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityStdDev[1]);
201  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityStdDev[2]);
202 
203  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->position[0]);
204  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->position[1]);
205  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->position[2]);
206 
207  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->undulation);
208 
209  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->positionStdDev[0]);
210  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->positionStdDev[1]);
211  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->positionStdDev[2]);
212 
213  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->status);
214 
215  //
216  // Return if any error has occurred while writing the frame
217  //
218  return sbgStreamBufferGetLastError(pOutputStream);
219 }
SbgErrorCode sbgEComBinaryLogParseEkfNavData(SbgStreamBuffer *pInputStream, SbgLogEkfNavData *pOutputData)
SBG_INLINE float sbgStreamBufferReadFloatLE(SbgStreamBuffer *pHandle)
This file is used to parse received EKF compued data binary logs.
SBG_INLINE SbgErrorCode sbgStreamBufferWriteDoubleLE(SbgStreamBuffer *pHandle, double value)
SbgErrorCode sbgEComBinaryLogWriteEkfNavData(SbgStreamBuffer *pOutputStream, const SbgLogEkfNavData *pInputData)
SbgErrorCode sbgEComBinaryLogWriteEkfQuatData(SbgStreamBuffer *pOutputStream, const SbgLogEkfQuatData *pInputData)
SbgErrorCode sbgEComBinaryLogParseEkfEulerData(SbgStreamBuffer *pInputStream, SbgLogEkfEulerData *pOutputData)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteFloatLE(SbgStreamBuffer *pHandle, float value)
SbgErrorCode sbgEComBinaryLogParseEkfQuatData(SbgStreamBuffer *pInputStream, SbgLogEkfQuatData *pOutputData)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint32LE(SbgStreamBuffer *pHandle, uint32_t value)
SbgErrorCode sbgEComBinaryLogWriteEkfEulerData(SbgStreamBuffer *pOutputStream, const SbgLogEkfEulerData *pInputData)
SBG_INLINE uint32_t sbgStreamBufferReadUint32LE(SbgStreamBuffer *pHandle)
SBG_INLINE double sbgStreamBufferReadDoubleLE(SbgStreamBuffer *pHandle)
enum _SbgErrorCode SbgErrorCode
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


sbg_driver
Author(s): SBG Systems
autogenerated on Sat Sep 3 2022 02:53:35