|
Sensor Fusion Library 0.6.1
Orientation sensing for Espressif (ESP32, ESP8266) processors
|
Functions to convert between various orientation representations. More...

Go to the source code of this file.
Classes | |
| struct | Quaternion |
| quaternion structure definition More... | |
Typedefs | |
| typedef struct Quaternion | Quaternion |
| quaternion structure definition | |
Functions | |
| void | f3DOFTiltNED (float fR[][3], float fGc[]) |
| Aerospace NED accelerometer 3DOF tilt function, computing rotation matrix fR. | |
| void | f3DOFTiltAndroid (float fR[][3], float fGc[]) |
| Android accelerometer 3DOF tilt function computing, rotation matrix fR. | |
| void | f3DOFTiltWin8 (float fR[][3], float fGc[]) |
| Windows 8 accelerometer 3DOF tilt function computing, rotation matrix fR. | |
| void | f3DOFMagnetometerMatrixNED (float fR[][3], float fBc[]) |
| Aerospace NED magnetometer 3DOF flat eCompass function, computing rotation matrix fR. | |
| void | f3DOFMagnetometerMatrixAndroid (float fR[][3], float fBc[]) |
| Android magnetometer 3DOF flat eCompass function, computing rotation matrix fR. | |
| void | f3DOFMagnetometerMatrixWin8 (float fR[][3], float fBc[]) |
| Windows 8 magnetometer 3DOF flat eCompass function, computing rotation matrix fR. | |
| void | feCompassNED (float fR[][3], float *pfDelta, float *pfsinDelta, float *pfcosDelta, float fBc[], float fGc[], float *pfmodBc, float *pfmodGc) |
| NED: basic 6DOF e-Compass function, computing rotation matrix fR and magnetic inclination angle fDelta. | |
| void | feCompassAndroid (float fR[][3], float *pfDelta, float *pfsinDelta, float *pfcosDelta, float fBc[], float fGc[], float *pfmodBc, float *pfmodGc) |
| Android: basic 6DOF e-Compass function, computing rotation matrix fR and magnetic inclination angle fDelta. | |
| void | feCompassWin8 (float fR[][3], float *pfDelta, float *pfsinDelta, float *pfcosDelta, float fBc[], float fGc[], float *pfmodBc, float *pfmodGc) |
| Win8: basic 6DOF e-Compass function, computing rotation matrix fR and magnetic inclination angle fDelta. | |
| void | fNEDAnglesDegFromRotationMatrix (float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg) |
| extract the NED angles in degrees from the NED rotation matrix | |
| void | fAndroidAnglesDegFromRotationMatrix (float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg) |
| extract the Android angles in degrees from the Android rotation matrix | |
| void | fWin8AnglesDegFromRotationMatrix (float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg) |
| extract the Windows 8 angles in degrees from the Windows 8 rotation matrix | |
| void | fQuaternionFromRotationMatrix (float R[][3], Quaternion *pq) |
| compute the orientation quaternion from a 3x3 rotation matrix | |
| void | fRotationMatrixFromQuaternion (float R[][3], const Quaternion *pq) |
| compute the rotation matrix from an orientation quaternion | |
| void | qAeqBxC (Quaternion *pqA, const Quaternion *pqB, const Quaternion *pqC) |
| function compute the quaternion product qB * qC | |
| void | qAeqAxB (Quaternion *pqA, const Quaternion *pqB) |
| function compute the quaternion product qA = qA * qB | |
| Quaternion | qconjgAxB (const Quaternion *pqA, const Quaternion *pqB) |
| function compute the quaternion product conjg(qA) * qB | |
| void | fqAeqNormqA (Quaternion *pqA) |
| function normalizes a rotation quaternion and ensures q0 is non-negative | |
| void | fqAeq1 (Quaternion *pqA) |
| set a quaternion to the unit quaternion | |
| void | fQuaternionFromRotationVectorDeg (Quaternion *pq, const float rvecdeg[], float fscaling) |
| computes normalized rotation quaternion from a rotation vector (deg) | |
| void | fRotationVectorDegFromQuaternion (Quaternion *pq, float rvecdeg[]) |
| computes rotation vector (deg) from rotation quaternion | |
| void | fLPFOrientationQuaternion (Quaternion *pq, Quaternion *pLPq, float flpf, float fdeltat, float fOmega[]) |
| function low pass filters an orientation quaternion and computes virtual gyro rotation rate | |
| void | fveqconjgquq (Quaternion *pfq, float fu[], float fv[]) |
Functions to convert between various orientation representations.
Functions to convert between various orientation representations. Also includes functions for manipulating quaternions.
Definition in file orientation.h.
| void f3DOFMagnetometerMatrixAndroid | ( | float | fR[][3], |
| float | fBc[] | ||
| ) |
Android magnetometer 3DOF flat eCompass function, computing rotation matrix fR.
| fR | computed rotation matrix (output) |
| fBc | calibrated magnetometer reading (input) |
Definition at line 224 of file orientation.c.
| void f3DOFMagnetometerMatrixNED | ( | float | fR[][3], |
| float | fBc[] | ||
| ) |
Aerospace NED magnetometer 3DOF flat eCompass function, computing rotation matrix fR.
| fR | computed rotation matrix (output) |
| fBc | calibrated magnetometer reading (input) |
Definition at line 194 of file orientation.c.
| void f3DOFMagnetometerMatrixWin8 | ( | float | fR[][3], |
| float | fBc[] | ||
| ) |
Windows 8 magnetometer 3DOF flat eCompass function, computing rotation matrix fR.
| fR | computed rotation matrix (output) |
| fBc | calibrated magnetometer reading (input) |
Definition at line 254 of file orientation.c.
| void f3DOFTiltAndroid | ( | float | fR[][3], |
| float | fGc[] | ||
| ) |
Android accelerometer 3DOF tilt function computing, rotation matrix fR.
| fR | computed rotation matrix (output) |
| fGc | calibrated accelerometer input vector |
| void f3DOFTiltNED | ( | float | fR[][3], |
| float | fGc[] | ||
| ) |
Aerospace NED accelerometer 3DOF tilt function, computing rotation matrix fR.
| fR | computed rotation matrix (output) |
| fGc | calibrated accelerometer input vector |
| void f3DOFTiltWin8 | ( | float | fR[][3], |
| float | fGc[] | ||
| ) |
Windows 8 accelerometer 3DOF tilt function computing, rotation matrix fR.
| fR | computed rotation matrix (output) |
| fGc | calibrated accelerometer input vector |
| void fAndroidAnglesDegFromRotationMatrix | ( | float | R[][3], |
| float * | pfPhiDeg, | ||
| float * | pfTheDeg, | ||
| float * | pfPsiDeg, | ||
| float * | pfRhoDeg, | ||
| float * | pfChiDeg | ||
| ) |
extract the Android angles in degrees from the Android rotation matrix
| R | rotation matrix input |
| pfPhiDeg | the roll angle -90.0 <= Phi <= 90.0 deg |
| pfTheDeg | the pitch angle -180.0 <= The < 180.0 deg |
| pfPsiDeg | yaw angle Psi with range 0.0 <= Psi < 360.0 deg |
| pfRhoDeg | the compass heading angle Rho equals the yaw angle Psi |
| pfChiDeg | the tilt angle from vertical Chi (0 <= Chi <= 180 deg) |
Definition at line 543 of file orientation.c.
| void feCompassAndroid | ( | float | fR[][3], |
| float * | pfDelta, | ||
| float * | pfsinDelta, | ||
| float * | pfcosDelta, | ||
| float | fBc[], | ||
| float | fGc[], | ||
| float * | pfmodBc, | ||
| float * | pfmodGc | ||
| ) |
Android: basic 6DOF e-Compass function, computing rotation matrix fR and magnetic inclination angle fDelta.
| fR | computed rotation matrix (output) |
| pfDelta | magnetic inclination angle (output) |
| pfsinDelta | sin of the inclination angle |
| pfcosDelta | cos of the inclination angle |
| fBc | calibrated magnetometer reading (input) |
| fGc | calibrated accelerometer input vector (input) |
| pfmodBc | modulus of the calibrated magnetic vector |
| pfmodGc | modulus of the calibrated accelerometer vector |
Definition at line 338 of file orientation.c.
| void feCompassNED | ( | float | fR[][3], |
| float * | pfDelta, | ||
| float * | pfsinDelta, | ||
| float * | pfcosDelta, | ||
| float | fBc[], | ||
| float | fGc[], | ||
| float * | pfmodBc, | ||
| float * | pfmodGc | ||
| ) |
NED: basic 6DOF e-Compass function, computing rotation matrix fR and magnetic inclination angle fDelta.
| fR | computed rotation matrix (output) |
| pfDelta | magnetic inclination angle (output) |
| pfsinDelta | sin of the inclination angle |
| pfcosDelta | cos of the inclination angle |
| fBc | calibrated magnetometer vector (input) |
| fGc | calibrated accelerometer input vector (input) |
| pfmodBc | modulus of the calibrated magnetic vector |
| pfmodGc | modulus of the calibrated accelerometer vector |
Definition at line 265 of file orientation.c.
| void feCompassWin8 | ( | float | fR[][3], |
| float * | pfDelta, | ||
| float * | pfsinDelta, | ||
| float * | pfcosDelta, | ||
| float | fBc[], | ||
| float | fGc[], | ||
| float * | pfmodBc, | ||
| float * | pfmodGc | ||
| ) |
Win8: basic 6DOF e-Compass function, computing rotation matrix fR and magnetic inclination angle fDelta.
| fR | computed rotation matrix (output) |
| pfDelta | magnetic inclination angle (output) |
| pfsinDelta | sin of the inclination angle |
| pfcosDelta | cos of the inclination angle |
| fBc | calibrated magnetometer reading (input) |
| fGc | calibrated accelerometer input vector (input) |
| pfmodBc | modulus of the calibrated magnetic vector |
| pfmodGc | modulus of the calibrated accelerometer vector |
Definition at line 412 of file orientation.c.
| void fLPFOrientationQuaternion | ( | Quaternion * | pq, |
| Quaternion * | pLPq, | ||
| float | flpf, | ||
| float | fdeltat, | ||
| float | fOmega[] | ||
| ) |
function low pass filters an orientation quaternion and computes virtual gyro rotation rate
Definition at line 891 of file orientation.c.
| void fNEDAnglesDegFromRotationMatrix | ( | float | R[][3], |
| float * | pfPhiDeg, | ||
| float * | pfTheDeg, | ||
| float * | pfPsiDeg, | ||
| float * | pfRhoDeg, | ||
| float * | pfChiDeg | ||
| ) |
extract the NED angles in degrees from the NED rotation matrix
| R | rotation matrix input |
| pfPhiDeg | output: the roll angle range -180.0 <= Phi < 180.0 deg |
| pfTheDeg | output: the pitch angle -90.0 <= Theta <= 90.0 deg |
| pfPsiDeg | output: the yaw (compass) angle 0.0 <= Psi < 360.0 deg |
| pfRhoDeg | output: For NED, the compass heading Rho equals the yaw angle Psi |
| pfChiDeg | output: the tilt angle from vertical Chi (0 <= Chi <= 180 deg) |
Definition at line 487 of file orientation.c.
| void fqAeq1 | ( | Quaternion * | pqA | ) |
set a quaternion to the unit quaternion
Definition at line 1013 of file orientation.c.
| void fqAeqNormqA | ( | Quaternion * | pqA | ) |
function normalizes a rotation quaternion and ensures q0 is non-negative
Definition at line 978 of file orientation.c.
| void fQuaternionFromRotationMatrix | ( | float | R[][3], |
| Quaternion * | pq | ||
| ) |
compute the orientation quaternion from a 3x3 rotation matrix
| R | Rotation matrix (input) |
| pq | Quaternion (output) |
Definition at line 760 of file orientation.c.
| void fQuaternionFromRotationVectorDeg | ( | Quaternion * | pq, |
| const float | rvecdeg[], | ||
| float | fscaling | ||
| ) |
computes normalized rotation quaternion from a rotation vector (deg)
| pq | quaternion (output) |
| rvecdeg | rotation vector in degrees |
| fscaling | delta Time |
Definition at line 692 of file orientation.c.
| void fRotationMatrixFromQuaternion | ( | float | R[][3], |
| const Quaternion * | pq | ||
| ) |
compute the rotation matrix from an orientation quaternion
| R | Rotation matrix (output) |
| pq | Quaternion (input) |
Definition at line 801 of file orientation.c.
| void fRotationVectorDegFromQuaternion | ( | Quaternion * | pq, |
| float | rvecdeg[] | ||
| ) |
computes rotation vector (deg) from rotation quaternion
| pq | quaternion (input) |
| rvecdeg | rotation vector in degrees (output) |
Definition at line 841 of file orientation.c.
| void fveqconjgquq | ( | Quaternion * | pfq, |
| float | fu[], | ||
| float | fv[] | ||
| ) |
function computes the rotation quaternion that rotates unit vector u onto unit vector v as v=q*.u.q using q = 1/sqrt(2) * {sqrt(1 + u.v) - u x v / sqrt(1 + u.v)}
Definition at line 1023 of file orientation.c.
| void fWin8AnglesDegFromRotationMatrix | ( | float | R[][3], |
| float * | pfPhiDeg, | ||
| float * | pfTheDeg, | ||
| float * | pfPsiDeg, | ||
| float * | pfRhoDeg, | ||
| float * | pfChiDeg | ||
| ) |
extract the Windows 8 angles in degrees from the Windows 8 rotation matrix
| R | rotation matrix input |
| pfPhiDeg | the roll angle -90.0 <= Phi <= 90.0 deg |
| pfTheDeg | pitch angle Theta in the range -180.0 <= The < 180.0 deg |
| pfPsiDeg | yaw angle Psi in range 0.0 <= Psi < 360.0 deg |
| pfRhoDeg | the compass angle Rho = 360 - Psi |
| pfChiDeg | tilt angle from vertical Chi (0 <= Chi <= 180 deg) |
Definition at line 600 of file orientation.c.
| void qAeqAxB | ( | Quaternion * | pqA, |
| const Quaternion * | pqB | ||
| ) |
function compute the quaternion product qA = qA * qB
Definition at line 948 of file orientation.c.
| void qAeqBxC | ( | Quaternion * | pqA, |
| const Quaternion * | pqB, | ||
| const Quaternion * | pqC | ||
| ) |
function compute the quaternion product qB * qC
Definition at line 937 of file orientation.c.
| Quaternion qconjgAxB | ( | const Quaternion * | pqA, |
| const Quaternion * | pqB | ||
| ) |
function compute the quaternion product conjg(qA) * qB
Definition at line 965 of file orientation.c.