#ifndef _PDR_AHRS_H_ #define _PDR_AHRS_H_ #ifdef __cplusplus extern "C" { #endif /* Header File Including ------------------------------------------------------------------------ */ #include "pdr_sensor.h" /* Macro Declaration ---------------------------------------------------------------------------- */ #define AHRS_SAMPLE_FREQ 100 // ARHS算法的传感器采样频率 #define IMU_SAMPLING_FREQUENCY 100 #define AHRS_KP 0.500 #define AHRS_TYPE_GYRO 4 #define AHRS_TYPE_ACCE 1 #define AHRS_TYPE_MAGN 2 #define AHRS_STATUS_RESET_PHASE_0 0x80 #define AHRS_STATUS_RESET_PHASE_1 0x40 #define AHRS_STATUS_RESET (AHRS_STATUS_RESET_PHASE_0|AHRS_STATUS_RESET_PHASE_1) #define AHRS_STATUS_STABLE 0x20 /* Struct Declaration --------------------------------------------------------------------------- */ /* Function Declaration ------------------------------------------------------------------------- */ void AHRS_Init(void); void ResetARHS(void); /**--------------------------------------------------------------------- * Function : fv3Norm * Description : 三维浮点数向量归一化 * Date : 2021/01/26 yuanlin@vivocom && * * *---------------------------------------------------------------------**/ void fv3Norm(float* vx, float* vy, float* vz); int UpdateAHRS(imu* imu); #ifdef __cplusplus } #endif #endif // for __AHRS_H