Master Thesis
V1.0
Research and Design of Sensor Node for NMSD Treatment
|
Sensor fusion. More...
Go to the source code of this file.
Macros | |
#define | sampleFreq 51.136f |
#define | M_PI 3.14159265358979323846 |
Functions | |
float | invSqrt (float x) |
void | MadgwickAHRSupdate (float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz) |
Madgwick algorithm. More... | |
void | MadgwickAHRSupdateIMU (float gx, float gy, float gz, float ax, float ay, float az) |
Madgwick algorithm. More... | |
void | QuaternionsToEulerAngles (float *euler_angles) |
Convert quaternions to euler angles. More... | |
Variables | |
volatile float | q0 = 1.0f |
volatile float | q1 = 0.0f |
volatile float | q2 = 0.0f |
volatile float | q3 = 0.0f |
volatile float | yaw =0.0f |
volatile float | pitch =0.0f |
volatile float | roll =0.0f |
#define M_PI 3.14159265358979323846 |
Definition of PI
Definition at line 39 of file MadgwickAHRS.c.
#define sampleFreq 51.136f |
sample frequency in Hz
Definition at line 35 of file MadgwickAHRS.c.
float invSqrt | ( | float | x | ) |
Calculate inverse sqrt
Definition at line 289 of file MadgwickAHRS.c.
Referenced by MadgwickAHRSupdate(), and MadgwickAHRSupdateIMU().
void MadgwickAHRSupdate | ( | float | gx, |
float | gy, | ||
float | gz, | ||
float | ax, | ||
float | ay, | ||
float | az, | ||
float | mx, | ||
float | my, | ||
float | mz | ||
) |
Madgwick algorithm.
9 DoF sensor fusion
[in] | gx | Gyro x |
[in] | gy | Gyro y |
[in] | gz | Gyro a |
[in] | ax | Accel x |
[in] | ay | Accel y |
[in] | az | Accel a |
[in] | mx | Magn x |
[in] | my | Magn y |
[in] | mz | Magn a |
Definition at line 92 of file MadgwickAHRS.c.
References beta, invSqrt(), MadgwickAHRSupdateIMU(), q0, q1, q2, q3, and sampleFreq.
Referenced by measure_send().
void MadgwickAHRSupdateIMU | ( | float | gx, |
float | gy, | ||
float | gz, | ||
float | ax, | ||
float | ay, | ||
float | az | ||
) |
Madgwick algorithm.
6 DoF sensor fusion
[in] | gx | Gyro x |
[in] | gy | Gyro y |
[in] | gz | Gyro a |
[in] | ax | Accel x |
[in] | ay | Accel y |
[in] | az | Accel a |
Definition at line 217 of file MadgwickAHRS.c.
References beta, invSqrt(), q0, q1, q2, q3, and sampleFreq.
Referenced by MadgwickAHRSupdate().
void QuaternionsToEulerAngles | ( | float * | euler_angles | ) |
Convert quaternions to euler angles.
[out] | euler_angles | pointer to location of euler angles storage |
Definition at line 351 of file MadgwickAHRS.c.
References M_PI, pitch, q0, q1, q2, q3, roll, and yaw.
Referenced by measure_send().
volatile float pitch =0.0f |
Definition at line 46 of file MadgwickAHRS.c.
Referenced by QuaternionsToEulerAngles().
volatile float q0 = 1.0f |
Definition at line 45 of file MadgwickAHRS.c.
Referenced by MadgwickAHRSupdate(), MadgwickAHRSupdateIMU(), and QuaternionsToEulerAngles().
volatile float q1 = 0.0f |
Definition at line 45 of file MadgwickAHRS.c.
Referenced by MadgwickAHRSupdate(), MadgwickAHRSupdateIMU(), and QuaternionsToEulerAngles().
volatile float q2 = 0.0f |
Definition at line 45 of file MadgwickAHRS.c.
Referenced by MadgwickAHRSupdate(), MadgwickAHRSupdateIMU(), and QuaternionsToEulerAngles().
volatile float q3 = 0.0f |
quaternion of sensor frame relative to auxiliary frame
Definition at line 45 of file MadgwickAHRS.c.
Referenced by MadgwickAHRSupdate(), MadgwickAHRSupdateIMU(), and QuaternionsToEulerAngles().
volatile float roll =0.0f |
Yaw, pith, roll result
Definition at line 46 of file MadgwickAHRS.c.
Referenced by QuaternionsToEulerAngles().
volatile float yaw =0.0f |
Definition at line 46 of file MadgwickAHRS.c.
Referenced by QuaternionsToEulerAngles().