Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
include.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------
2 // Copyright (c) 2011, 2012, 2013 Freescale Semiconductor, Inc.
3 // ----------------------------------------------------------------------------
4 // FILENAME: include.h
5 // CONTENTS: COMPILE TIME CONSTANTS AND STRUCTURES
6 // DEPARTMENT: ANALOG AND SENSORS DIVISION
7 // AUTHOR: MARK PEDLEY
8 // ----------------------------------------------------------------------------
9 // VERSION DATE AUTHOR
10 // V1.0 20 FEB 2012 MARK PEDLEY
11 // V1.1 1 JUN 2012 MARK PEDLEY
12 // V1.2 15 JUN 2012 MARK PEDLEY
13 // V2.0 3 JUL 2012 MARK PEDLEY
14 // V3.0 (this version) 18 MAR 2013 MARK PEDLEY
15 // ----------------------------------------------------------------------------
16 // PURPOSE:
17 // Tilt-compensated e-compass with magnetic calibration with support
18 // for Aerospace (NED), Android and Windows 8 coordinate systems.
19 // Sensor simulation is used to verify code on target platform
20 // before interfacing to real sensors.
21 // This code does not include low level drivers for the accelerometer
22 // and magnetometer sensors since these are straightforward to write
23 // and specific to the processor and sensors being used.
24 //
25 // Most errors when moving to a real platform result from not aligning
26 // the individual sensor axes to the product axes. If you see roll, pitch
27 // or compass heading angle errors of -90, 90 or 180 degrees then
28 // re-check your sensor alignment.
29 // ----------------------------------------------------------------------------
30 // USER-CONFIGURABLE VALUES:
31 // FCOUNTSPERUT, FCOUNTSPERG, FUTPERCOUNT: Set to values for sensors selected
32 // ANGLE_LPF_FPU: Set to degree of low pass filtering required.
33 // DELTAT: Set to sampling interval (s) between runs of eCOMPASS
34 // CALINTERVAL: Calibration need only run intermittently
35 // ----------------------------------------------------------------------------
36 // V3.0 ENHANCEMENTS:
37 // - Numerous minor enhancements to improve accuracy
38 // - Significant reduction in RAM and CPU in the magnetic calibration solvers
39 // - Users of V2 code need not upgrade to V3 unless RAM and CPU are an issue.
40 // ----------------------------------------------------------------------------
41 
42 #include "stdio.h"
43 //#include "conio.h"
44 #include "math.h"
45 #include "stdlib.h"
46 #include "string.h"
47 //#include "time.h"
48 
49 // typedefs for Microsoft Visual Studio
50 //typedef _int16 int16;
51 //typedef unsigned _int16 uint16;
52 //typedef _int32 int32;
53 //typedef unsigned _int32 uint32;
54 
55 // typedefs for Freescale Codewarrior
56 typedef char int8;
57 typedef unsigned char uint8;
58 typedef short int int16;
59 typedef unsigned short int uint16;
60 typedef long int int32;
61 typedef unsigned long int uint32;
62 
63 // sensor scaling constants
64 #define FCOUNTSPERUT 10.0F // sensor specific: MAG3110 and FXOS8700 provide 10 counts / uT
65 #define FCOUNTSPERG 2048.0F // sensor specific: MMA8451 and FXOS8700 provide 2048 counts / g in 4g mode
66 #define FUTPERCOUNT 0.1F // MAG3110 and FXOS8700 provide 0.1uT per count resolution
67 
68 // orientation LPF cutoff = Nyquist / ANGLE_LPF_FPU
69 // so about ANGLE_LPF_FPU samples response
70 // ANGLE_LPF_FPU equal to 1.0F is valid and corresponds to all pass.
71 #define ANGLE_LPF_FPU 1.0F
72 // sampling interval (secs)
73 #define DELTAT 0.02F
74 
75 // coordinate system and eCompass option selected
76 #define NED 0 // identifier for NED angle output
77 #define ANDROID 1 // identifier for Android angle output
78 #define WIN8 2 // identifier for Windows 8 angle output
79 
80 // multiplicative conversion constants
81 #define PI 3.141592654F // Pi
82 #define FDEGTORAD 0.01745329251994F // degrees to radians conversion = pi / 180
83 #define FRADTODEG 57.2957795130823F // radians to degrees conversion = 180 / pi
84 #define FRECIP180 0.0055555555555F // multiplicative factor 1/180
85 #define FMATRIXSCALING 0.02F // approx normalizes geomagnetic field 50uT
86 #define FINVMATRIXSCALING 50.0F // inverse of FMATRIXSCALING
87 
88 // magnetic calibration constants
89 #define MAGBUFFSIZE 6 // magnetic buffer size: 6 implies 6^3 = 216 entries
90 #define INITIALCALINTERVAL 50 // 1s at 50Hz: initial (limited measurements) calibration interval
91 #define FINALCALINTERVAL 1500 // 30s at 50Hz: normal (sufficient measurements) calibration interval
92 #define MINEQUATIONS 24 // minimum number of measurements used for calibration
93 #define MEDEQUATIONS 80 // new solution always accepted up to this point
94 #define MAXEQUATIONS 120 // maximum number of measurements used for calibration
95 #define MINBFIT 5.0F // minimum acceptable geomagnetic field B (uT) for valid calibration
96 #define MAXBFIT 100.0F // maximum acceptable geomagnetic field B (uT) for valid calibration
97 #define FITERRORAGING 0.0033333F// reciprocal of time (s) for fit error to increase by e=2.718 (so here 300s=5 mins)
98 
99 // matrix inverse integer arrays
100 #define MAXMATINV 6 // maximum size supported in matrix inverse function
101 
102 // file access buffer size
103 #define BUFFSIZE 2048
104 
105 // quaternion structure definition
107 {
108  float q0; // scalar component
109  float q1; // x vector component
110  float q2; // y vector component
111  float q3; // z vector component
112 };
113 
114 // simulation model structure definition
116 {
117  // hard iron offset
118  float fVx; // simulated x component of hard iron
119  float fVy; // simulated y component of hard iron
120  float fVz; // simulated z component of hard iron
121  // soft iron matrix
122  float xinvW[3][3]; // simulated inverse soft iron matrix
123  float *finvW[3];
124  float xW[3][3]; // simulated forward soft iron matrix
125  float *fW[3];
126  // geomagnetic field
127  float fB; // simulated geomagnetic field strength (uT)
128  float fDeltaDeg; // simulated geomagnetic inclination angle (deg)
129  // orientation Euler angles
130  float fPhiDeg; // simulated roll angle (deg)
131  float fTheDeg; // simulated pitch angle (deg)
132  float fPsiDeg; // simulated yaw angle (deg)
133  float fRhoDeg; // simulated compass angle (deg)
134 };
135 
136 // accelerometer sensor structure definition
138 {
139  int16 iGpx; // accelerometer sensor output x (counts)
140  int16 iGpy; // accelerometer sensor output y (counts)
141  int16 iGpz; // accelerometer sensor output z (counts)
142  float fGpx; // accelerometer sensor output x (g)
143  float fGpy; // accelerometer sensor output y (g)
144  float fGpz; // accelerometer sensor output z (g)
145 };
146 
147 // magnetometer sensor structure definition
148 struct MagSensor
149 {
150  int16 iBpx; // magnetometer sensor output x (counts)
151  int16 iBpy; // magnetometer sensor output y (counts)
152  int16 iBpz; // magnetometer sensor output z (counts)
153  int16 iBcx; // calibrated magnetometer sensor output x (counts)
154  int16 iBcy; // calibrated magnetometer sensor output y (counts)
155  int16 iBcz; // calibrated magnetometer sensor output z (counts)
156  int16 iBfx; // de-rotated magnetometer sensor output x (counts)
157  int16 iBfy; // de-rotated magnetometer sensor output y (counts)
158  int16 iBfz; // de-rotated magnetometer sensor output z (counts)
159  float fBpx; // magnetometer sensor output x (uT)
160  float fBpy; // magnetometer sensor output y (uT)
161  float fBpz; // magnetometer sensor output z (uT)
162  float fBcx; // calibrated magnetometer sensor output x (uT)
163  float fBcy; // calibrated magnetometer sensor output y (uT)
164  float fBcz; // calibrated magnetometer sensor output z (uT)
165  float fBfx; // de-rotated magnetometer sensor output x (counts)
166  float fBfy; // de-rotated magnetometer sensor output y (counts)
167  float fBfz; // de-rotated magnetometer sensor output z (counts)
168 };
169 
170 // magnetic calibration structure
172 {
173  float fVx; // x component of computed hard iron offset
174  float fVy; // y component of computed hard iron offset
175  float fVz; // z component of computed hard iron offset
176  float fB; // computed geomagnetic field magnitude in uT
177  float fFitErrorpc; // computed fit error %
178  float ftrVx; // trial value of x component of hard iron offset
179  float ftrVy; // trial value of y component of hard iron offset
180  float ftrVz; // trial value of z component of hard iron offset
181  float ftrB; // trial value of geomagnetic field magnitude in uT
182  float ftrFitErrorpc; // trial value of fit error %
183  int32 iValidMagCal; // valid magnetic calibration flag
184  float xfinvW[3][3]; // estimated inverse soft iron matrix size
185  float *finvW[3];
186  float xfA[3][3]; // estimated ellipsoid matrix A
187  float *fA[3];
188  float xinvA[3][3]; // inverse of ellipsoid matrix A
189  float *finvA[3];
190  float xftrinvW[3][3] ;// trial computed inverse soft iron matrix size
191  float *ftrinvW[3];
192 };
193 
194 // 6DOF orientation structure definition
195 struct SV6DOF
196 {
197  // Euler angles
198  float fPhi6DOF; // 6DOF roll (deg)
199  float fThe6DOF; // 6DOF pitch (deg)
200  float fPsi6DOF; // 6DOF yaw (deg)
201  float fRho6DOF; // 6DOF compass (deg)
202  float fLPPhi6DOF; // 6DOF low pass roll (deg)
203  float fLPThe6DOF; // 6DOF low pass pitch (deg)
204  float fLPPsi6DOF; // 6DOF low pass yaw (deg)
205  float fLPRho6DOF; // 6DOF low pass compass (deg)
206  float fDelta6DOFn; // 6DOF inclination angle (deg) sample n
207  float fDelta6DOFnm1; // 6DOF inclination angle (deg) sample n-1
208  float fDelta6DOFnm2; // 6DOF inclination angle (deg) sample n-2
209  float fLPDelta6DOFn; // 6DOF low pass inclination angle (deg) sample n
210  float fLPDelta6DOFnm1; // 6DOF low pass inclination angle (deg) sample n-1
211  float fLPDelta6DOFnm2; // 6DOF low pass inclination angle (deg) sample n-2
212  // orientation matrices and quaternions
213  float xfR6DOFn[3][3]; // 6DOF rotation matrix for current sample n
214  float *fR6DOFn[3];
215  float xfR6DOFnm1[3][3];// 6DOF rotation matrix for sample n-1
216  float *fR6DOFnm1[3];
217  float xfR6DOFnm2[3][3]; // 6DOF rotation matrix for sample n-2
218  float *fR6DOFnm2[3];
219  float xfLPR6DOFn[3][3]; // low pass 6DOF rotation matrix for sample n
220  float *fLPR6DOFn[3];
221  float xfLPR6DOFnm1[3][3]; // low pass 6DOF rotation matrix for sample n-1
222  float *fLPR6DOFnm1[3];
223  float xfLPR6DOFnm2[3][3]; // low pass 6DOF rotation matrix for sample n-2
224  float *fLPR6DOFnm2[3];
225  struct fquaternion fq6DOFn; // current 6DOF orientation quaternion
226  struct fquaternion fLPq6DOFn; // low pass 6DOF orientation quaternion
227 };
228 
229 // magnetometer measurement buffer
231 {
232  int16 iBx[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE]; // array of x magnetic fields
233  int16 iBy[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE]; // array of y magnetic fields
234  int16 iBz[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE]; // array of z magnetic fields
235  int32 index[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE]; // array of time indices
236  int32 iMagBufferCount; // number of magnetometer readings
237 };
238 
239 // sensor driver function prototypes
240 uint8 fSixDOFSensorDrivers(struct AccelSensor *pthisAccel, struct MagSensor *pthisMag);
241 // sensor driver init function prototype
243 // floating point xtrinsic eCompass function prototypes
244 void feCompassDirectNED(struct SV6DOF *pthisSV6DOF, struct MagSensor *pthisMag,
245  struct AccelSensor *pthisAccel);
246 void feCompassDirectAndroid(struct SV6DOF *pthisSV6DOF, struct MagSensor *pthisMag,
247  struct AccelSensor *pthisAccel);
248 void feCompassDirectWin8(struct SV6DOF *pthisSV6DOF, struct MagSensor *pthisMag,
249  struct AccelSensor *pthisAccel);
250 void fInitLPFOrientationMatrix(float *pfb0, float *pfa1, float *pfa2);
251 void fLPFOrientationMatrix(struct SV6DOF *pthisSV6DOF, int32 iCoordSystem, int32 loopcounter,
252  float fb0, float fa1, float fa2);
253 // magnetometer buffer function prototypes
254 void fUpdateMagnetometerBuffer(struct MagneticBuffer *pthisMagneticBuffer,
255  struct MagSensor *pthisMag, struct AccelSensor *pthisAccel, int32 loopcounter);
256 // magnetic calibration function prototypes
257 void fUpdateCalibration10EIG(struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer,
258  float **ftmpA10x10, float **ftmpB10x10, float **ftmpA10x1, float **ftmpA3x3, float **ftmpA3x1);
259 void fUpdateCalibration7EIG(struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer,
260  float **ftmpA7x7, float **ftmpB7x7, float **ftmpA7x1);
261 void fUpdateCalibration4INV(struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer,
262  float **ftmpA4x4, float **ftmpB4x4, float **ftmpA4x1, float **ftmpB4x1,
263  int32 **icolind, int32 **irowind, int32 **ipivot);
264 void ResetMagCalibration(struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer);
265 void fInvertMagCal(struct MagSensor *pthisMag, struct MagCalibration *pthisMagCal);
266 // matrix algebra function prototypes
267 void fmatrixAeqBxC(float **A, float **B, float **C, int32 rB, int32 cBrC, int32 cC);
268 void fmatrixAeqTrBxC(float **A, float **B, float **C, int32 rBrC, int32 cB, int32 cC);
269 void fmatrixAeqBxTrB(float **A, float **B, int32 rB, int32 cB);
270 void fmatrixAeqI(float **A, int32 rc);
271 void fmatrixPrintA(float **A, int32 r1, int32 r2, int32 c1, int32 c2);
272 void f3x3matrixAeqInvSymB(float **A, float **B);
273 void fmatrixAeqRootSymB(float **A, float **B, float **ftmpmat, float **ftmpvec, int32 rc);
274 void fmatrixAeqB(float **A, float **B, int32 r, int32 c);
275 void fmatrixAeqAxScalar(float **A, float Scalar, int32 r, int32 c);
276 void fmatrixAeqMinusA(float **A, int32 r, int32 c);
277 void fmatrixAeqInvA(float **A, int32 isize, int32 **icolind, int32 **irowind, int32 **ipivot);
278 float f3x3matrixDetA(float **inp);
279 void eigencompute(float **mat, int32 n, float **eigval, float **eigvec);
280 void fmatrixAeqRenormRotA(float **A);
281 // conversion functions
282 void fQuaternionFromRotationMatrix(float **R, struct fquaternion *pq);
283 void fNEDAnglesDegFromRotationMatrix(float **R, float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg);
284 void fAndroidAnglesDegFromRotationMatrix(float **R, float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg);
285 void fWin8AnglesDegFromRotationMatrix(float **R, float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg);
float xfR6DOFnm1[3][3]
Definition: include.h:215
float * finvW[3]
Definition: include.h:185
int16 iGpy
Definition: include.h:140
float fB
Definition: include.h:176
int16 iBfx
Definition: include.h:156
void fUpdateCalibration7EIG(struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer, float **ftmpA7x7, float **ftmpB7x7, float **ftmpA7x1)
Definition: magnetic.c:180
int16 iGpx
Definition: include.h:139
int32 iMagBufferCount
Definition: include.h:236
float q1
Definition: include.h:109
float ftrVy
Definition: include.h:179
float xW[3][3]
Definition: include.h:124
int16 iBfz
Definition: include.h:158
float fRho6DOF
Definition: include.h:201
float fPsi6DOF
Definition: include.h:200
float fDeltaDeg
Definition: include.h:128
float ftrVz
Definition: include.h:180
int16 iBcz
Definition: include.h:155
Definition: include.h:230
void fInvertMagCal(struct MagSensor *pthisMag, struct MagCalibration *pthisMagCal)
Definition: magnetic.c:68
float fBcy
Definition: include.h:163
int16 iBpz
Definition: include.h:152
float fLPDelta6DOFn
Definition: include.h:209
void fmatrixAeqB(float **A, float **B, int32 r, int32 c)
Definition: matrix.c:226
short int int16
16 bits
Definition: arm_cm0.h:101
float ftrFitErrorpc
Definition: include.h:182
int16 iBpy
Definition: include.h:151
float q2
Definition: include.h:110
float xfR6DOFn[3][3]
Definition: include.h:213
float fLPPhi6DOF
Definition: include.h:202
float xfinvW[3][3]
Definition: include.h:184
Definition: include.h:137
float * finvW[3]
Definition: include.h:123
void fUpdateCalibration10EIG(struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer, float **ftmpA10x10, float **ftmpB10x10, float **ftmpA10x1, float **ftmpA3x3, float **ftmpA3x1)
Definition: magnetic.c:165
void fLPFOrientationMatrix(struct SV6DOF *pthisSV6DOF, int32 iCoordSystem, int32 loopcounter, float fb0, float fa1, float fa2)
Definition: orientation.c:307
void fQuaternionFromRotationMatrix(float **R, struct fquaternion *pq)
Definition: orientation.c:526
float fPhi6DOF
Definition: include.h:198
float fLPPsi6DOF
Definition: include.h:204
void fmatrixAeqInvA(float **A, int32 isize, int32 **icolind, int32 **irowind, int32 **ipivot)
Definition: matrix.c:439
void fmatrixAeqRootSymB(float **A, float **B, float **ftmpmat, float **ftmpvec, int32 rc)
Definition: matrix.c:244
float fVy
Definition: include.h:174
float fPsiDeg
Definition: include.h:132
float * fW[3]
Definition: include.h:125
void fInitLPFOrientationMatrix(float *pfb0, float *pfa1, float *pfa2)
Definition: orientation.c:283
struct fquaternion fq6DOFn
Definition: include.h:225
float fLPDelta6DOFnm2
Definition: include.h:211
float xftrinvW[3][3]
Definition: include.h:190
float fBcx
Definition: include.h:162
float fBfy
Definition: include.h:166
float fBfx
Definition: include.h:165
void feCompassDirectAndroid(struct SV6DOF *pthisSV6DOF, struct MagSensor *pthisMag, struct AccelSensor *pthisAccel)
Definition: orientation.c:121
void fmatrixAeqAxScalar(float **A, float Scalar, int32 r, int32 c)
Definition: matrix.c:127
float fVy
Definition: include.h:119
void fmatrixAeqBxTrB(float **A, float **B, int32 rB, int32 cB)
Definition: matrix.c:85
int16 iBz[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE]
Definition: include.h:234
float f3x3matrixDetA(float **inp)
Definition: matrix.c:177
void fmatrixAeqBxC(float **A, float **B, float **C, int32 rB, int32 cBrC, int32 cC)
Definition: matrix.c:40
void fmatrixAeqRenormRotA(float **A)
Definition: matrix.c:569
float xinvW[3][3]
Definition: include.h:122
float xfLPR6DOFn[3][3]
Definition: include.h:219
float fBcz
Definition: include.h:164
int16 iBpx
Definition: include.h:150
float fFitErrorpc
Definition: include.h:177
float fRhoDeg
Definition: include.h:133
float q3
Definition: include.h:111
float fLPThe6DOF
Definition: include.h:203
float * fLPR6DOFn[3]
Definition: include.h:220
Definition: include.h:148
float fBpy
Definition: include.h:160
float fVx
Definition: include.h:118
float fGpz
Definition: include.h:144
float * fLPR6DOFnm1[3]
Definition: include.h:222
float fB
Definition: include.h:127
float fPhiDeg
Definition: include.h:130
float * fR6DOFn[3]
Definition: include.h:214
float xfLPR6DOFnm1[3][3]
Definition: include.h:221
#define MAGBUFFSIZE
Definition: include.h:89
float xfLPR6DOFnm2[3][3]
Definition: include.h:223
float xfR6DOFnm2[3][3]
Definition: include.h:217
float ftrVx
Definition: include.h:178
Definition: include.h:106
void ResetMagCalibration(struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer)
Definition: magnetic.c:40
int16 iBx[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE]
Definition: include.h:232
float * fR6DOFnm1[3]
Definition: include.h:216
float fBfz
Definition: include.h:167
int16 iBcy
Definition: include.h:154
float fVz
Definition: include.h:120
Definition: include.h:195
int16 iBcx
Definition: include.h:153
float * fLPR6DOFnm2[3]
Definition: include.h:224
int32 iValidMagCal
Definition: include.h:183
float * fA[3]
Definition: include.h:187
void f3x3matrixAeqInvSymB(float **A, float **B)
Definition: matrix.c:190
void fUpdateCalibration4INV(struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer, float **ftmpA4x4, float **ftmpB4x4, float **ftmpA4x1, float **ftmpB4x1, int32 **icolind, int32 **irowind, int32 **ipivot)
Definition: magnetic.c:342
float * fR6DOFnm2[3]
Definition: include.h:218
void fmatrixPrintA(float **A, int32 r1, int32 r2, int32 c1, int32 c2)
Definition: matrix.c:161
int int32
32 bits
Definition: arm_cm0.h:102
void fUpdateMagnetometerBuffer(struct MagneticBuffer *pthisMagneticBuffer, struct MagSensor *pthisMag, struct AccelSensor *pthisAccel, int32 loopcounter)
Definition: magnetic.c:93
float fVz
Definition: include.h:175
float * ftrinvW[3]
Definition: include.h:191
float fBpx
Definition: include.h:159
float fThe6DOF
Definition: include.h:199
Definition: include.h:115
int32 index[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE]
Definition: include.h:235
void eigencompute(float **mat, int32 n, float **eigval, float **eigvec)
Definition: matrix.c:280
void fmatrixAeqI(float **A, int32 rc)
Definition: matrix.c:109
float fVx
Definition: include.h:173
float fGpx
Definition: include.h:142
float fBpz
Definition: include.h:161
float fDelta6DOFnm2
Definition: include.h:208
void fAndroidAnglesDegFromRotationMatrix(float **R, float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg)
Definition: orientation.c:415
char int8
8 bits
Definition: arm_cm0.h:100
float q0
Definition: include.h:108
float fLPDelta6DOFnm1
Definition: include.h:210
float xinvA[3][3]
Definition: include.h:188
int16 iBfy
Definition: include.h:157
uint8 SensorDrivers_Init()
Definition: driverwrapper.c:42
struct fquaternion fLPq6DOFn
Definition: include.h:226
unsigned char uint8
The basic data types.
Definition: arm_cm0.h:96
void feCompassDirectWin8(struct SV6DOF *pthisSV6DOF, struct MagSensor *pthisMag, struct AccelSensor *pthisAccel)
Definition: orientation.c:202
int16 iBy[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE]
Definition: include.h:233
void fmatrixAeqMinusA(float **A, int32 r, int32 c)
Definition: matrix.c:144
unsigned short int uint16
16 bits
Definition: arm_cm0.h:97
float fTheDeg
Definition: include.h:131
float * finvA[3]
Definition: include.h:189
void fNEDAnglesDegFromRotationMatrix(float **R, float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg)
Definition: orientation.c:385
unsigned long int uint32
32 bits
Definition: arm_cm0.h:98
float fLPRho6DOF
Definition: include.h:205
void fmatrixAeqTrBxC(float **A, float **B, float **C, int32 rBrC, int32 cB, int32 cC)
Definition: matrix.c:62
uint8 fSixDOFSensorDrivers(struct AccelSensor *pthisAccel, struct MagSensor *pthisMag)
Definition: driverwrapper.c:56
Definition: include.h:171
float fGpy
Definition: include.h:143
float xfA[3][3]
Definition: include.h:186
void fWin8AnglesDegFromRotationMatrix(float **R, float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg)
Definition: orientation.c:446
float fDelta6DOFnm1
Definition: include.h:207
int16 iGpz
Definition: include.h:141
void feCompassDirectNED(struct SV6DOF *pthisSV6DOF, struct MagSensor *pthisMag, struct AccelSensor *pthisAccel)
Definition: orientation.c:40
float ftrB
Definition: include.h:181
float fDelta6DOFn
Definition: include.h:206