1 //=====================================================================================================
\r
3 //=====================================================================================================
\r
5 // Implementation of Madgwick's IMU and AHRS algorithms.
\r
6 // See: http://www.x-io.co.uk/node/8#open_source_ahrs_and_imu_algorithms
\r
9 // 29/09/2011 SOH Madgwick Initial release
\r
10 // 02/10/2011 SOH Madgwick Optimised for reduced CPU load
\r
12 //=====================================================================================================
\r
13 #ifndef MadgwickAHRS_h
\r
14 #define MadgwickAHRS_h
\r
16 //----------------------------------------------------------------------------------------------------
\r
17 // Variable declaration
\r
19 extern volatile float beta; // algorithm gain
\r
20 extern volatile float q0, q1, q2, q3; // quaternion of sensor frame relative to auxiliary frame
\r
22 //---------------------------------------------------------------------------------------------------
\r
23 // Function declarations
\r
25 void MadgwickAHRSupdate(float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz);
\r
26 void MadgwickAHRSupdateIMU(float gx, float gy, float gz, float ax, float ay, float az);
\r
27 void Mad_f32_init(void);
\r
28 void MadgwickAHRSupdateIMU_f32(float gx, float gy, float gz, float ax, float ay, float az);
\r
31 //=====================================================================================================
\r
33 //=====================================================================================================
\r