MahonyAHRS.h 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. //=============================================================================================
  2. // MahonyAHRS.h
  3. //=============================================================================================
  4. //
  5. // Madgwick's implementation of Mayhony's AHRS algorithm.
  6. // See: http://www.x-io.co.uk/open-source-imu-and-ahrs-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 MahonyAHRS_h
  14. #define MahonyAHRS_h
  15. #include <stdbool.h>
  16. #include <stdint.h>
  17. #include <string.h>
  18. #include "sdk_common.h"
  19. #include "SEGGER_RTT.h"
  20. #include "usr_config.h"
  21. void Mahony_process(int16_t gx, int16_t gy, int16_t gz, int16_t ax, int16_t ay, int16_t az, int16_t mx, int16_t my, int16_t mz);
  22. void Mahony_Init(float sampleFrequency);
  23. void Mahony_computeAngles(void);
  24. float getRoll(void);
  25. float getPitch(void);
  26. float getYaw(void);
  27. float getRollRadians(void);
  28. float getPitchRadians(void);
  29. float getYawRadians(void);
  30. void Mahony_send_ANO_SENSER(int16_t gx, int16_t gy, int16_t gz, int16_t ax, int16_t ay, int16_t az, int16_t mx, int16_t my, int16_t mz);
  31. #endif