47 lines
1.6 KiB
C
47 lines
1.6 KiB
C
|
#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<48>㷨<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>
|
|||
|
#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 pdr_initAhrs(void);
|
|||
|
void pdr_ahrsReset(void);
|
|||
|
|
|||
|
/**---------------------------------------------------------------------
|
|||
|
* Function : fv3Norm
|
|||
|
* Description : <EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>
|
|||
|
* Date : 2021/01/26 yuanlin@vivocom && zhanli@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
void fv3Norm(float* vx, float* vy, float* vz);
|
|||
|
|
|||
|
int pdr_imuUpdateAhrs(imu* imu);
|
|||
|
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
#endif // for __AHRS_H
|