TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle
tm_stm32_ahrs_imu.h
1 
37 #ifndef TM_AHRSIMU_H
38 #define TM_AHRSIMU_H 100
39 
40 /* C++ detection */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
73 #include "stdint.h"
74 #include "math.h"
75 
82 #define AHRSIMU_PI 3.141592653f /* PI definition */
83 #define AHRSIMU_RAD2DEG(x) ((x) * 57.2957795f) /* Radians to degrees converter */
84 #define AHRSIMU_DEG2RAD(x) ((x) * 0.0174532925f) /* Radians to degrees converter */
85 
99 typedef struct _TM_AHRSIMU_t {
100  float Roll; /* Roll angle value. This parameter is in units of degrees */
101  float Pitch; /* Pitch angle value. This parameter is in units of degrees */
102  float Yaw; /* Yaw angle value. This parameter is in units of degrees */
103  float Inclination; /* Inclination in units of degrees */
104 
105  float _beta;
106  float _q0, _q1, _q2, _q3;
107  float _sampleRate;
108 } TM_AHRSIMU_t;
109 
128 void TM_AHRSIMU_Init(TM_AHRSIMU_t* AHRSIMU, float sampleRate, float beta, float inclination);
129 
139 void TM_AHRSIMU_UpdateAHRS(TM_AHRSIMU_t* AHRSIMU, float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz);
140 
148 void TM_AHRSIMU_UpdateIMU(TM_AHRSIMU_t* AHRSIMU, float gx, float gy, float gz, float ax, float ay, float az);
149 
162 /* C++ detection */
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif
void TM_AHRSIMU_UpdateAHRS(TM_AHRSIMU_t *AHRSIMU, float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz)
Updates AHRS algorithm with new values and calculates roll, pitch and yaw angles. ...
Main working AHRS IMU structure.
Definition: tm_stm32_ahrs_imu.h:99
void TM_AHRSIMU_Init(TM_AHRSIMU_t *AHRSIMU, float sampleRate, float beta, float inclination)
Initializes ARHS or IMU algorithm for motion calculations.
void TM_AHRSIMU_UpdateIMU(TM_AHRSIMU_t *AHRSIMU, float gx, float gy, float gz, float ax, float ay, float az)
Updates IMU algorithm with new values and calculates roll, pitch and yaw angles.
struct _TM_AHRSIMU_t TM_AHRSIMU_t
Main working AHRS IMU structure.