27 lines
766 B
C
27 lines
766 B
C
#ifndef __IMU_H
|
|
#define __IMU_H
|
|
|
|
//#include "communicate.h"
|
|
#include "public_data.h"
|
|
//#include "SENSORS_TYPES.h"
|
|
#include "STABILIZER_TYPES.h"
|
|
|
|
//旋转机体坐标系加速度到NEU坐标系
|
|
void imuTransformVectorBodyToEarth(Axis3f *v);
|
|
//NEU坐标系加速度到NEU坐标系
|
|
void imuTransformVectorEarthToBody(Axis3f *v);
|
|
|
|
void imuMahonyAHRSupdate(float gx, float gy, float gz,float ax, float ay, float az,float mx, float my, float mz,bool useMag,float dt);
|
|
//四元数和欧拉角计算
|
|
void imuUpdate(Axis3f acc, Axis3f gyro, state_t *state , float dt); /*数据融合 互补滤波*/
|
|
void imuUpdateAttitude(const sensorData_t *sensorData, state_t *state, float dt);
|
|
void MadgwickQuaternionUpdate(Axis3f acc, Axis3f gyro, Axis3f mag, attitude_t *attitude , float dt);
|
|
void imuInit(void);
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|