sbgEComBinaryLogEkf.c
Go to the documentation of this file.
1 #include "sbgEComBinaryLogEkf.h"
2 
3 //----------------------------------------------------------------------//
4 //- Operations -//
5 //----------------------------------------------------------------------//
6 
14 {
15  //
16  // Check input arguments
17  //
18  SBG_ASSERT(pInputStream);
19  SBG_ASSERT(pOutputData);
20 
21  //
22  // Read the frame payload
23  //
24  pOutputData->timeStamp = sbgStreamBufferReadUint32LE(pInputStream);
25 
26  pOutputData->euler[0] = sbgStreamBufferReadFloatLE(pInputStream);
27  pOutputData->euler[1] = sbgStreamBufferReadFloatLE(pInputStream);
28  pOutputData->euler[2] = sbgStreamBufferReadFloatLE(pInputStream);
29 
30  pOutputData->eulerStdDev[0] = sbgStreamBufferReadFloatLE(pInputStream);
31  pOutputData->eulerStdDev[1] = sbgStreamBufferReadFloatLE(pInputStream);
32  pOutputData->eulerStdDev[2] = sbgStreamBufferReadFloatLE(pInputStream);
33 
34  pOutputData->status = sbgStreamBufferReadUint32LE(pInputStream);
35 
36  //
37  // Return if any error has occurred while parsing the frame
38  //
39  return sbgStreamBufferGetLastError(pInputStream);
40 }
41 
49 {
50  //
51  // Check input arguments
52  //
53  SBG_ASSERT(pOutputStream);
54  SBG_ASSERT(pInputData);
55 
56  //
57  // Write the frame payload
58  //
59  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
60 
61  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->euler[0]);
62  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->euler[1]);
63  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->euler[2]);
64 
65  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[0]);
66  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[1]);
67  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[2]);
68 
69  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->status);
70 
71  //
72  // Return if any error has occurred while writing the frame
73  //
74  return sbgStreamBufferGetLastError(pOutputStream);
75 }
76 
84 {
85  //
86  // Check input arguments
87  //
88  SBG_ASSERT(pInputStream);
89  SBG_ASSERT(pOutputData);
90 
91  //
92  // Read the frame payload
93  //
94  pOutputData->timeStamp = sbgStreamBufferReadUint32LE(pInputStream);
95 
96  pOutputData->quaternion[0] = sbgStreamBufferReadFloatLE(pInputStream);
97  pOutputData->quaternion[1] = sbgStreamBufferReadFloatLE(pInputStream);
98  pOutputData->quaternion[2] = sbgStreamBufferReadFloatLE(pInputStream);
99  pOutputData->quaternion[3] = sbgStreamBufferReadFloatLE(pInputStream);
100 
101  pOutputData->eulerStdDev[0] = sbgStreamBufferReadFloatLE(pInputStream);
102  pOutputData->eulerStdDev[1] = sbgStreamBufferReadFloatLE(pInputStream);
103  pOutputData->eulerStdDev[2] = sbgStreamBufferReadFloatLE(pInputStream);
104 
105  pOutputData->status = sbgStreamBufferReadUint32LE(pInputStream);
106 
107  //
108  // Return if any error has occurred while parsing the frame
109  //
110  return sbgStreamBufferGetLastError(pInputStream);
111 }
112 
120 {
121  //
122  // Check input arguments
123  //
124  SBG_ASSERT(pOutputStream);
125  SBG_ASSERT(pInputData);
126 
127  //
128  // Write the frame payload
129  //
130  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
131 
132  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->quaternion[0]);
133  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->quaternion[1]);
134  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->quaternion[2]);
135  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->quaternion[3]);
136 
137  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[0]);
138  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[1]);
139  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->eulerStdDev[2]);
140 
141  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->status);
142 
143  //
144  // Return if any error has occurred while writing the frame
145  //
146  return sbgStreamBufferGetLastError(pOutputStream);
147 }
148 
156 {
157  //
158  // Check input arguments
159  //
160  SBG_ASSERT(pInputStream);
161  SBG_ASSERT(pOutputData);
162 
163  //
164  // Read the frame payload
165  //
166  pOutputData->timeStamp = sbgStreamBufferReadUint32LE(pInputStream);
167 
168  pOutputData->velocity[0] = sbgStreamBufferReadFloatLE(pInputStream);
169  pOutputData->velocity[1] = sbgStreamBufferReadFloatLE(pInputStream);
170  pOutputData->velocity[2] = sbgStreamBufferReadFloatLE(pInputStream);
171 
172  pOutputData->velocityStdDev[0] = sbgStreamBufferReadFloatLE(pInputStream);
173  pOutputData->velocityStdDev[1] = sbgStreamBufferReadFloatLE(pInputStream);
174  pOutputData->velocityStdDev[2] = sbgStreamBufferReadFloatLE(pInputStream);
175 
176  pOutputData->position[0] = sbgStreamBufferReadDoubleLE(pInputStream);
177  pOutputData->position[1] = sbgStreamBufferReadDoubleLE(pInputStream);
178  pOutputData->position[2] = sbgStreamBufferReadDoubleLE(pInputStream);
179 
180  pOutputData->undulation = sbgStreamBufferReadFloatLE(pInputStream);
181 
182  pOutputData->positionStdDev[0] = sbgStreamBufferReadFloatLE(pInputStream);
183  pOutputData->positionStdDev[1] = sbgStreamBufferReadFloatLE(pInputStream);
184  pOutputData->positionStdDev[2] = sbgStreamBufferReadFloatLE(pInputStream);
185 
186  pOutputData->status = sbgStreamBufferReadUint32LE(pInputStream);
187 
188  //
189  // Return if any error has occurred while parsing the frame
190  //
191  return sbgStreamBufferGetLastError(pInputStream);
192 }
193 
201 {
202  //
203  // Check input arguments
204  //
205  SBG_ASSERT(pOutputStream);
206  SBG_ASSERT(pInputData);
207 
208  //
209  // Write the frame payload
210  //
211  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
212 
213  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[0]);
214  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[1]);
215  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[2]);
216 
217  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityStdDev[0]);
218  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityStdDev[1]);
219  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityStdDev[2]);
220 
221  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->position[0]);
222  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->position[1]);
223  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->position[2]);
224 
225  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->undulation);
226 
227  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->positionStdDev[0]);
228  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->positionStdDev[1]);
229  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->positionStdDev[2]);
230 
231  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->status);
232 
233  //
234  // Return if any error has occurred while writing the frame
235  //
236  return sbgStreamBufferGetLastError(pOutputStream);
237 }
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 uint32 sbgStreamBufferReadUint32LE(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteFloatLE(SbgStreamBuffer *pHandle, float value)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint32LE(SbgStreamBuffer *pHandle, uint32 value)
SbgErrorCode sbgEComBinaryLogParseEkfQuatData(SbgStreamBuffer *pInputStream, SbgLogEkfQuatData *pOutputData)
#define SBG_ASSERT(expression)
Definition: sbgDebug.h:52
SbgErrorCode sbgEComBinaryLogWriteEkfEulerData(SbgStreamBuffer *pOutputStream, const SbgLogEkfEulerData *pInputData)
SBG_INLINE double sbgStreamBufferReadDoubleLE(SbgStreamBuffer *pHandle)
enum _SbgErrorCode SbgErrorCode
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


sbg_driver
Author(s):
autogenerated on Sun Jan 27 2019 03:42:20