72 static char iCommandBuffer[5] =
"~~~~";
79 for (i = 0; i < nbytes; i++) {
81 for (j = 0; j < 3; j++)
82 iCommandBuffer[j] = iCommandBuffer[j + 1];
83 iCommandBuffer[3] = input_buffer[i];
86 isum = ((((((int32_t)iCommandBuffer[0] << 8) | iCommandBuffer[1]) << 8) | iCommandBuffer[2]) << 8) | iCommandBuffer[3];
89 sfg->pControlSubsystem->AngularVelocityPacketOn =
true;
90 iCommandBuffer[3] =
'~';
94 sfg->pControlSubsystem->AngularVelocityPacketOn =
false;
95 iCommandBuffer[3] =
'~';
99 sfg->pControlSubsystem->DebugPacketOn =
true;
100 iCommandBuffer[3] =
'~';
104 sfg->pControlSubsystem->DebugPacketOn =
false;
105 iCommandBuffer[3] =
'~';
110 sfg->pControlSubsystem->QuaternionPacketType =
Q3;
112 iCommandBuffer[3] =
'~';
117 sfg->pControlSubsystem->QuaternionPacketType =
Q3M;
119 iCommandBuffer[3] =
'~';
124 sfg->pControlSubsystem->QuaternionPacketType =
Q3G;
126 iCommandBuffer[3] =
'~';
131 sfg->pControlSubsystem->QuaternionPacketType =
Q6MA;
133 iCommandBuffer[3] =
'~';
138 sfg->pControlSubsystem->QuaternionPacketType =
Q6AG;
140 iCommandBuffer[3] =
'~';
145 sfg->pControlSubsystem->QuaternionPacketType =
Q9;
147 iCommandBuffer[3] =
'~';
151 sfg->pControlSubsystem->RPCPacketOn =
true;
152 iCommandBuffer[3] =
'~';
156 sfg->pControlSubsystem->RPCPacketOn =
false;
157 iCommandBuffer[3] =
'~';
161 sfg->pControlSubsystem->AltPacketOn =
true;
162 iCommandBuffer[3] =
'~';
166 sfg->pControlSubsystem->AltPacketOn =
false;
167 iCommandBuffer[3] =
'~';
172 fInitializeFusion(sfg);
182 iCommandBuffer[3] =
'~';
187 for (i =
CHX; i <=
CHZ; i++) {
188 sfg->SV_9DOF_GBY_KALMAN.fVelGl[i] = 0.0F;
189 sfg->SV_9DOF_GBY_KALMAN.fDisGl[i] = 0.0F;
192 iCommandBuffer[3] =
'~';
196 SaveMagCalibrationToNVM(sfg);
197 SaveGyroCalibrationToNVM(sfg);
198 SaveAccelCalibrationToNVM(sfg);
199 iCommandBuffer[3] =
'~';
203 SaveMagCalibrationToNVM(sfg);
204 iCommandBuffer[3] =
'~';
208 SaveGyroCalibrationToNVM(sfg);
209 iCommandBuffer[3] =
'~';
213 SaveAccelCalibrationToNVM(sfg);
214 iCommandBuffer[3] =
'~';
218 EraseMagCalibrationFromNVM();
219 EraseGyroCalibrationFromNVM();
220 EraseAccelCalibrationFromNVM();
221 iCommandBuffer[3] =
'~';
225 EraseMagCalibrationFromNVM();
226 iCommandBuffer[3] =
'~';
230 EraseGyroCalibrationFromNVM();
231 iCommandBuffer[3] =
'~';
235 EraseAccelCalibrationFromNVM();
236 iCommandBuffer[3] =
'~';
241 iCommandBuffer[3] =
'~';
246 iCommandBuffer[3] =
'~';
251 iCommandBuffer[3] =
'~';
256 iCommandBuffer[3] =
'~';
261 iCommandBuffer[3] =
'~';
266 iCommandBuffer[3] =
'~';
271 iCommandBuffer[3] =
'~';
276 iCommandBuffer[3] =
'~';
281 iCommandBuffer[3] =
'~';
286 sfg->AccelBuffer.iStoreLocation = 0;
288 iCommandBuffer[3] =
'~';
292 sfg->AccelBuffer.iStoreLocation = 1;
294 iCommandBuffer[3] =
'~';
298 sfg->AccelBuffer.iStoreLocation = 2;
300 iCommandBuffer[3] =
'~';
304 sfg->AccelBuffer.iStoreLocation = 3;
306 iCommandBuffer[3] =
'~';
310 sfg->AccelBuffer.iStoreLocation = 4;
312 iCommandBuffer[3] =
'~';
316 sfg->AccelBuffer.iStoreLocation = 5;
318 iCommandBuffer[3] =
'~';
322 sfg->AccelBuffer.iStoreLocation = 6;
324 iCommandBuffer[3] =
'~';
328 sfg->AccelBuffer.iStoreLocation = 7;
330 iCommandBuffer[3] =
'~';
334 sfg->AccelBuffer.iStoreLocation = 8;
336 iCommandBuffer[3] =
'~';
340 sfg->AccelBuffer.iStoreLocation = 9;
342 iCommandBuffer[3] =
'~';
346 sfg->AccelBuffer.iStoreLocation = 10;
348 iCommandBuffer[3] =
'~';
352 sfg->AccelBuffer.iStoreLocation = 11;
354 iCommandBuffer[3] =
'~';