IMU filter
MadgwickAHRS.h@0:0c61d7209f75, 2016-05-30 (annotated)
- Committer:
- Decimus
- Date:
- Mon May 30 08:10:20 2016 +0000
- Revision:
- 0:0c61d7209f75
[+]
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Decimus | 0:0c61d7209f75 | 1 | // MadgwickAHRS.h |
Decimus | 0:0c61d7209f75 | 2 | //===================================================================================================== |
Decimus | 0:0c61d7209f75 | 3 | // |
Decimus | 0:0c61d7209f75 | 4 | // Implementation of Madgwick's IMU and AHRS algorithms. |
Decimus | 0:0c61d7209f75 | 5 | // See: http://www.x-io.co.uk/node/8#open_source_ahrs_and_imu_algorithms |
Decimus | 0:0c61d7209f75 | 6 | // |
Decimus | 0:0c61d7209f75 | 7 | // Date Author Notes |
Decimus | 0:0c61d7209f75 | 8 | // 29/09/2011 SOH Madgwick Initial release |
Decimus | 0:0c61d7209f75 | 9 | // 02/10/2011 SOH Madgwick Optimised for reduced CPU load |
Decimus | 0:0c61d7209f75 | 10 | // |
Decimus | 0:0c61d7209f75 | 11 | //===================================================================================================== |
Decimus | 0:0c61d7209f75 | 12 | #ifndef MadgwickAHRS_h |
Decimus | 0:0c61d7209f75 | 13 | #define MadgwickAHRS_h |
Decimus | 0:0c61d7209f75 | 14 | |
Decimus | 0:0c61d7209f75 | 15 | //---------------------------------------------------------------------------------------------------- |
Decimus | 0:0c61d7209f75 | 16 | // Variable declaration |
Decimus | 0:0c61d7209f75 | 17 | extern int instability_fix; |
Decimus | 0:0c61d7209f75 | 18 | extern volatile float beta; // algorithm gain |
Decimus | 0:0c61d7209f75 | 19 | extern volatile float q0, q1, q2, q3; // quaternion of sensor frame relative to auxiliary frame |
Decimus | 0:0c61d7209f75 | 20 | |
Decimus | 0:0c61d7209f75 | 21 | //extern volatile float quat[4]; |
Decimus | 0:0c61d7209f75 | 22 | |
Decimus | 0:0c61d7209f75 | 23 | //--------------------------------------------------------------------------------------------------- |
Decimus | 0:0c61d7209f75 | 24 | // Function declarations |
Decimus | 0:0c61d7209f75 | 25 | |
Decimus | 0:0c61d7209f75 | 26 | void MadgwickAHRSupdate(float tdelta, float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz); |
Decimus | 0:0c61d7209f75 | 27 | void MadgwickAHRSupdateIMU(float tdelta, float gx, float gy, float gz, float ax, float ay, float az); |
Decimus | 0:0c61d7209f75 | 28 | float invSqrt(float x); |
Decimus | 0:0c61d7209f75 | 29 | |
Decimus | 0:0c61d7209f75 | 30 | #endif |
Decimus | 0:0c61d7209f75 | 31 | //===================================================================================================== |
Decimus | 0:0c61d7209f75 | 32 | // End of file |
Decimus | 0:0c61d7209f75 | 33 | //===================================================================================================== |