This repository has been archived by the owner on May 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMadgwickAHRS.h
35 lines (29 loc) · 1.66 KB
/
MadgwickAHRS.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//=====================================================================================================
// MadgwickAHRS.h
//=====================================================================================================
//
// Implementation of Madgwick's IMU and AHRS algorithms.
// See: http://www.x-io.co.uk/node/8#open_source_ahrs_and_imu_algorithms
//
// Date Author Notes
// 29/09/2011 SOH Madgwick Initial release
// 02/10/2011 SOH Madgwick Optimised for reduced CPU load
//
//=====================================================================================================
#ifndef MadgwickAHRS_h
#define MadgwickAHRS_h
//---------------------------------------------------------------------------------------------------
// Definitions
#define MadgwickBetaDef 0.25 // 2 * proportional gain
//----------------------------------------------------------------------------------------------------
// Variable declaration
extern double madgwick_beta; // algorithm gain
extern double q_a[4]; // quaternion of sensor frame relative to auxiliary frame
//---------------------------------------------------------------------------------------------------
// Function declarations
void MadgwickAHRSupdate(double gx, double gy, double gz, double ax, double ay, double az, double mx, double my, double mz, double deltat);
void MadgwickGYROupdate(double gx, double gy, double gz, double deltat);
#endif
//=====================================================================================================
// End of file
//=====================================================================================================