MadgwickAHRS.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. //=====================================================================================================
  2. // MadgwickAHRS.h
  3. //=====================================================================================================
  4. //
  5. // Implementation of Madgwick's IMU and AHRS algorithms.
  6. // See: http://www.x-io.co.uk/node/8#open_source_ahrs_and_imu_algorithms
  7. //
  8. // Date Author Notes
  9. // 29/09/2011 SOH Madgwick Initial release
  10. // 02/10/2011 SOH Madgwick Optimised for reduced CPU load
  11. //
  12. //=====================================================================================================
  13. #ifndef MadgwickAHRS_h
  14. #define MadgwickAHRS_h
  15. //----------------------------------------------------------------------------------------------------
  16. // Variable declaration
  17. // extern volatile float q0, q1, q2, q3; // quaternion of sensor frame
  18. // relative to auxiliary frame
  19. //---------------------------------------------------------------------------------------------------
  20. // Function declarations
  21. void MadgwickAHRSupdate(float gx, float gy, float gz, float ax, float ay,
  22. float az, float mx, float my, float mz);
  23. void MadgwickAHRSupdateIMU(float gx, float gy, float gz, float ax, float ay,
  24. float az, float *pitch, float *roll, float *yaw);
  25. void MadgwickAHRSetBeta(float beta);
  26. #endif
  27. //=====================================================================================================
  28. // End of file
  29. //=====================================================================================================