PDR/1.Software/PDR 1.2.0/include/Detector.h

82 lines
2.8 KiB
C
Raw Normal View History

2022-10-07 23:49:43 +08:00
#ifndef __DETECTOR_H
#define __DETECTOR_H
#ifdef __cplusplus
extern "C" {
#endif
/* Header File Including ------------------------------------------------------------------------ */
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
2024-12-06 21:30:26 +08:00
#include "PDRBase.h"
2022-10-07 23:49:43 +08:00
#include "buffer.h"
#include "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 --------------------------------------------------------------------------- */
/* Global Variable Declaration ------------------------------------------------------------------ */
extern BUFFER_SHORT AccFrqBuf[3];
extern BUFFER_SHORT AccAmpBuf[3];
extern BUFFER_SHORT GyrFrqBuf[3];
extern BUFFER_SHORT GyrAmpBuf[3];
2022-10-07 23:49:43 +08:00
/* Function Declaration ------------------------------------------------------------------------- */
/**---------------------------------------------------------------------
* Function : GetDetectorObj
* Description : <EFBFBD><EFBFBD>ȡPDR<EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* Date : 2020/02/16 logzhan
2022-10-07 23:49:43 +08:00
*---------------------------------------------------------------------**/
Detector_t *GetDetectorObj(void);
2022-10-07 23:49:43 +08:00
/**---------------------------------------------------------------------
* Function : Detector_Init
* 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 : 2022/09/23 logzhan
*---------------------------------------------------------------------**/
Detector_t* Detector_Init(void);
2022-10-07 23:49:43 +08:00
/**---------------------------------------------------------------------
* Function : DetectorReset
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>PDR<EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* Date : 2022/09/23 logzhan
*---------------------------------------------------------------------**/
void DetectorReset(void);
/**---------------------------------------------------------------------
* Function : DetectMotionType
* Description : pdr<EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD>
* Date : 2020/7/20
*---------------------------------------------------------------------**/
int DetectMotionType(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 logzhan
*---------------------------------------------------------------------**/
int DetectorPredict(float* feature);
2022-10-07 23:49:43 +08:00
/**---------------------------------------------------------------------
* Function : DetectorUpdateIMU
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>imu<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><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* Date : 2022/09/23
*---------------------------------------------------------------------**/
void DetectorUpdateIMU(IMU_t* imu);
#ifdef __cplusplus
}
#endif
#endif