84 lines
2.9 KiB
C
84 lines
2.9 KiB
C
|
#ifndef __DETECTOR_H
|
|||
|
#define __DETECTOR_H
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
extern "C" {
|
|||
|
#endif
|
|||
|
|
|||
|
/* Header File Including ------------------------------------------------------------------------ */
|
|||
|
#include <stdint.h>
|
|||
|
#include <stdlib.h>
|
|||
|
#include <time.h>
|
|||
|
#include "pdr_base.h"
|
|||
|
#include "buffer.h"
|
|||
|
#include "pdr_ahrs.h"
|
|||
|
|
|||
|
/* Macro Declaration ---------------------------------------------------------------------------- */
|
|||
|
#define DETECTOR_NO_ERROR 0
|
|||
|
#define DETECTOR_OUT_OF_MEMORY 1
|
|||
|
|
|||
|
#define MAG_BUF_LEN 256
|
|||
|
#define MAG_LEN 6
|
|||
|
|
|||
|
/* Struct Declaration --------------------------------------------------------------------------- */
|
|||
|
|
|||
|
|
|||
|
typedef void (*DETECTOR_update_callback)(DETECTOR *detector);
|
|||
|
|
|||
|
/* Global Variable Declaration ------------------------------------------------------------------ */
|
|||
|
extern BUFFER_SHORT g_acc_frq_buf[3];
|
|||
|
extern BUFFER_SHORT g_acc_amp_buf[3];
|
|||
|
extern BUFFER_SHORT g_gyr_frq_buf[3];
|
|||
|
extern BUFFER_SHORT g_gyr_amp_buf[3];
|
|||
|
|
|||
|
/* Function Declaration ------------------------------------------------------------------------- */
|
|||
|
|
|||
|
/**---------------------------------------------------------------------
|
|||
|
* Function : pdr_getDetector
|
|||
|
* Description : <EFBFBD><EFBFBD>ȡPDR<EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľṹ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|||
|
* Date : 2020/02/16 yuanlin_rjyb@vivo.com & zhanli@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
DETECTOR *pdr_getDetector(void);
|
|||
|
|
|||
|
/**---------------------------------------------------------------------
|
|||
|
* Function : pdr_initDetector
|
|||
|
* Description : <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>ģʽ
|
|||
|
* Date : 2020/02/16 yuanlin_rjyb@vivo.com & zhanli@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
DETECTOR* pdr_initDetector(void);
|
|||
|
|
|||
|
/**---------------------------------------------------------------------
|
|||
|
* Function : pdr_resetDetector
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>PDR<EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Date : 2020/02/16 yuanlin_rjyb@vivo.com & zhanli@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
void pdr_resetDetector(void);
|
|||
|
|
|||
|
/**---------------------------------------------------------------------
|
|||
|
* Function : pdr_motionTypeDetect
|
|||
|
* Description : pdr<EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Date : 2020/7/20 yuanlin_rjyb@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
int pdr_motionTypeDetect(void);
|
|||
|
|
|||
|
/**---------------------------------------------------------------------
|
|||
|
* Function : predict
|
|||
|
* Description : <EFBFBD>ж<EFBFBD><EFBFBD>ֻ<EFBFBD>Я<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD>ֳ֡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵȣ<EFBFBD>
|
|||
|
* Date : 2020/7/20 yuanlin_rjyb@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
int pdr_detectorPredict(float* feature);
|
|||
|
|
|||
|
void mag_calibration(IMU *imu);
|
|||
|
void mag_m_trans(float a[MAG_BUF_LEN][3], float r[3][MAG_BUF_LEN]);
|
|||
|
void mag_min(float a[MAG_BUF_LEN], float *mag_min);
|
|||
|
void mag_max(float a[MAG_BUF_LEN], float *mag_max);
|
|||
|
void mag_rand(float r[6]);
|
|||
|
|
|||
|
void updateDetectorImu(imu* imu);
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
#endif
|