ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
orientation.h
Go to the documentation of this file.
1 // Copyright (c) 2014, 2015, Freescale Semiconductor, Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name of Freescale Semiconductor, Inc. nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 // DISCLAIMED. IN NO EVENT SHALL FREESCALE SEMICONDUCTOR, INC. BE LIABLE FOR ANY
19 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 #ifndef ORIENTATION_H
27 #define ORIENTATION_H
28 
29 
30 
31 // function prototypes
32 void f3DOFTiltNED(float fR[][3], float fGs[]);
33 void f3DOFTiltAndroid(float fR[][3], float fGs[]);
34 void f3DOFTiltWin8(float fR[][3], float fGs[]);
35 void f3DOFMagnetometerMatrixNED(float fR[][3], float fBc[]);
36 void f3DOFMagnetometerMatrixAndroid(float fR[][3], float fBc[]);
37 void f3DOFMagnetometerMatrixWin8(float fR[][3], float fBc[]);
38 void feCompassNED(float fR[][3], float *pfDelta, float fBc[], float fGs[]);
39 void feCompassAndroid(float fR[][3], float *pfDelta, float fBc[], float fGs[]);
40 void feCompassWin8(float fR[][3], float *pfDelta, float fBc[], float fGs[]);
41 
42 void fLeastSquareseCompassNED(struct fquaternion *pfq, float fB, float fDelta, float fsinDelta, float fcosDelta,
43  float *pfDelta6DOF, float fBc[], float fGs[], float *pfQvB, float *pfQvG);
44 void fLeastSquareseCompassAndroid(struct fquaternion *pfq, float fB, float fDelta, float fsinDelta, float fcosDelta,
45  float *pfDelta6DOF, float fBc[], float fGs[], float *pfQvB, float *pfQvG);
46 void fLeastSquareseCompassWin8(struct fquaternion *pfq, float fB, float fDelta, float fsinDelta, float fcosDelta,
47  float *pfDelta6DOF, float fBc[], float fGs[], float *pfQvB, float *pfQvG);
48 
49 void fNEDAnglesDegFromRotationMatrix(float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg);
50 void fAndroidAnglesDegFromRotationMatrix(float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg);
51 void fWin8AnglesDegFromRotationMatrix(float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg);
52 void fQuaternionFromRotationMatrix(float R[][3], struct fquaternion *pq);
53 void fRotationMatrixFromQuaternion(float R[][3], const struct fquaternion *pq);
54 void qAeqBxC(struct fquaternion *pqA, const struct fquaternion *pqB, const struct fquaternion *pqC);
55 void qAeqAxB(struct fquaternion *pqA, const struct fquaternion *pqB);
56 struct fquaternion qconjgAxB(const struct fquaternion *pqA, const struct fquaternion *pqB);
57 void fqAeqNormqA(struct fquaternion *pqA);
58 void fqAeq1(struct fquaternion *pqA);
59 void fQuaternionFromRotationVectorDeg(struct fquaternion *pq, const float rvecdeg[], float fscaling);
60 void fRotationVectorDegFromQuaternion(struct fquaternion *pq, float rvecdeg[]);
61 void fLPFOrientationQuaternion(struct fquaternion *pq, struct fquaternion *pLPq, float flpf, float fdeltat, float fOmega[]);
62 void fveqconjgquq(struct fquaternion *pfq, float fu[], float fv[]);
63 
64 #endif // #ifndef ORIENTATION_H
void feCompassAndroid(float fR[][3], float *pfDelta, float fBc[], float fGs[])
Definition: orientation.c:326
void f3DOFMagnetometerMatrixAndroid(float fR[][3], float fBc[])
Definition: orientation.c:221
void feCompassNED(float fR[][3], float *pfDelta, float fBc[], float fGs[])
Definition: orientation.c:258
void fLeastSquareseCompassAndroid(struct fquaternion *pfq, float fB, float fDelta, float fsinDelta, float fcosDelta, float *pfDelta6DOF, float fBc[], float fGs[], float *pfQvB, float *pfQvG)
Definition: orientation.c:576
void fqAeqNormqA(struct fquaternion *pqA)
Definition: orientation.c:1296
void qAeqAxB(struct fquaternion *pqA, const struct fquaternion *pqB)
Definition: orientation.c:1266
void fLeastSquareseCompassNED(struct fquaternion *pfq, float fB, float fDelta, float fsinDelta, float fcosDelta, float *pfDelta6DOF, float fBc[], float fGs[], float *pfQvB, float *pfQvG)
Definition: orientation.c:463
void feCompassWin8(float fR[][3], float *pfDelta, float fBc[], float fGs[])
Definition: orientation.c:394
void fqAeq1(struct fquaternion *pqA)
Definition: orientation.c:1331
void f3DOFTiltWin8(float fR[][3], float fGs[])
Definition: orientation.c:119
void fQuaternionFromRotationMatrix(float R[][3], struct fquaternion *pq)
Definition: orientation.c:1067
void f3DOFTiltNED(float fR[][3], float fGs[])
Definition: orientation.c:44
void f3DOFTiltAndroid(float fR[][3], float fGs[])
Definition: orientation.c:110
void fveqconjgquq(struct fquaternion *pfq, float fu[], float fv[])
Definition: orientation.c:1341
void fLPFOrientationQuaternion(struct fquaternion *pq, struct fquaternion *pLPq, float flpf, float fdeltat, float fOmega[])
Definition: orientation.c:1198
void f3DOFMagnetometerMatrixWin8(float fR[][3], float fBc[])
Definition: orientation.c:249
void fLeastSquareseCompassWin8(struct fquaternion *pfq, float fB, float fDelta, float fsinDelta, float fcosDelta, float *pfDelta6DOF, float fBc[], float fGs[], float *pfQvB, float *pfQvG)
Definition: orientation.c:688
void fAndroidAnglesDegFromRotationMatrix(float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg)
Definition: orientation.c:853
void qAeqBxC(struct fquaternion *pqA, const struct fquaternion *pqB, const struct fquaternion *pqC)
Definition: orientation.c:1255
void fQuaternionFromRotationVectorDeg(struct fquaternion *pq, const float rvecdeg[], float fscaling)
Definition: orientation.c:999
struct fquaternion qconjgAxB(const struct fquaternion *pqA, const struct fquaternion *pqB)
Definition: orientation.c:1283
void fWin8AnglesDegFromRotationMatrix(float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg)
Definition: orientation.c:908
void fRotationVectorDegFromQuaternion(struct fquaternion *pq, float rvecdeg[])
Definition: orientation.c:1148
void fNEDAnglesDegFromRotationMatrix(float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg)
Definition: orientation.c:799
void f3DOFMagnetometerMatrixNED(float fR[][3], float fBc[])
Definition: orientation.c:193
void fRotationMatrixFromQuaternion(float R[][3], const struct fquaternion *pq)
Definition: orientation.c:1108