2022-10-07 23:49:43 +08:00
|
|
|
|
/******************** (C) COPYRIGHT 2020 Geek************************************
|
|
|
|
|
* File Name : pdr_api.h
|
|
|
|
|
* Department : Sensor Algorithm Team
|
|
|
|
|
* Current Version : V2.0(compare QCOM SAP 5.0)
|
|
|
|
|
* Author : logzhan
|
|
|
|
|
* Date of Issued : 2021.01.26
|
|
|
|
|
* Comments : PDR <EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD>ӿ<EFBFBD>
|
|
|
|
|
********************************************************************************/
|
|
|
|
|
#ifndef _PDR_API_H_
|
|
|
|
|
#define _PDR_API_H_
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Header File Including -----------------------------------------------------*/
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <math.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "pdr_sensor.h"
|
|
|
|
|
#include "pdr_base.h"
|
|
|
|
|
#include "Utils.h"
|
|
|
|
|
|
|
|
|
|
/* Macro Definition ----------------------------------------------------------*/
|
|
|
|
|
#define IMU_LAST_COUNT 10
|
|
|
|
|
|
|
|
|
|
typedef struct _PosFusion{
|
|
|
|
|
double lat;
|
|
|
|
|
double lon;
|
|
|
|
|
double gpsLat;
|
|
|
|
|
double gpsLon;
|
|
|
|
|
double t;
|
|
|
|
|
int vaild;
|
|
|
|
|
}PosFusion;
|
|
|
|
|
|
|
|
|
|
/* Function Declaration ------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
/**---------------------------------------------------------------------
|
2022-10-15 16:07:19 +08:00
|
|
|
|
* Function : Algorithm_Init
|
2022-10-07 23:49:43 +08:00
|
|
|
|
* Description : PDR<EFBFBD>㷨<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PDR<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>ڵij<EFBFBD>ʼ<EFBFBD><EFBFBD>
|
2022-10-15 16:07:19 +08:00
|
|
|
|
* Date : 2022/10/15 logzhan
|
2022-10-07 23:49:43 +08:00
|
|
|
|
*---------------------------------------------------------------------**/
|
|
|
|
|
void Algorithm_Init(void);
|
|
|
|
|
|
|
|
|
|
/**---------------------------------------------------------------------
|
2022-10-15 16:07:19 +08:00
|
|
|
|
* Function : LocationMainLoop
|
2022-10-07 23:49:43 +08:00
|
|
|
|
* Description : PDR<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>ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵij<EFBFBD>ʼ<EFBFBD><EFBFBD>
|
|
|
|
|
* Input : ss_data<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
nmea_data, NMEA<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
result<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* Output : int, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λ
|
|
|
|
|
* Date : 2020/7/3 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
2022-10-15 16:07:19 +08:00
|
|
|
|
int LocationMainLoop(IMU_t* ImuData, Nmea_t* NmeaData, LctFs_t* LocFusion,
|
2022-10-07 23:49:43 +08:00
|
|
|
|
FILE *fp_gps);
|
|
|
|
|
|
|
|
|
|
/**---------------------------------------------------------------------
|
|
|
|
|
* Function : pdr_locationMainLoopStr
|
|
|
|
|
* Description : PDR<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>ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵij<EFBFBD>ʼ<EFBFBD><EFBFBD>
|
|
|
|
|
* Date : 2020/07/03 logzhan
|
|
|
|
|
* 2020/02/02 logzhan : <EFBFBD><EFBFBD><EFBFBD>Ӻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>
|
|
|
|
|
*---------------------------------------------------------------------**/
|
2022-10-15 16:07:19 +08:00
|
|
|
|
int ParseLineAndUpdate(char* line, LctFs_t* result);
|
2022-10-07 23:49:43 +08:00
|
|
|
|
|
|
|
|
|
/**---------------------------------------------------------------------
|
|
|
|
|
* Function : pdr_initRmc
|
|
|
|
|
* Description : <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>RMC<EFBFBD>ṹ<EFBFBD><EFBFBD>
|
|
|
|
|
* Input : rmc<EFBFBD><EFBFBD> RMC<EFBFBD>ṹ<EFBFBD><EFBFBD>
|
|
|
|
|
* Date : 2020/7/3 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
2022-10-15 16:07:19 +08:00
|
|
|
|
void RMC_Init(NmeaRMC_t * rmc);
|
2022-10-07 23:49:43 +08:00
|
|
|
|
|
|
|
|
|
/**---------------------------------------------------------------------
|
|
|
|
|
* Function : pdr_initNmeaFlg
|
|
|
|
|
* Description : <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>GPS<EFBFBD><EFBFBD>NMEAЭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>־λ
|
|
|
|
|
* Input : ln<EFBFBD><EFBFBD> NMEA<EFBFBD>ṹ<EFBFBD><EFBFBD>
|
|
|
|
|
* Date : 2020/7/3 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
2022-10-15 16:07:19 +08:00
|
|
|
|
void NmeaFlag_Init(Nmea_t * ln);
|
2022-10-07 23:49:43 +08:00
|
|
|
|
|
|
|
|
|
/**---------------------------------------------------------------------
|
|
|
|
|
* Function : clearNmeaFlg
|
|
|
|
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Nmea<EFBFBD><EFBFBD>־λ,<EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD>init<EFBFBD><EFBFBD>ͬ
|
|
|
|
|
* Date : 2020/7/4 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
2022-10-15 16:07:19 +08:00
|
|
|
|
void ClearNmeaFlg(Nmea_t * ln);
|
2022-10-07 23:49:43 +08:00
|
|
|
|
|
|
|
|
|
/**---------------------------------------------------------------------
|
|
|
|
|
* Function : pdr_saveGnssInfo
|
|
|
|
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPS<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
* Date : 2020/7/3 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
2022-10-15 16:07:19 +08:00
|
|
|
|
void SaveGnssInfo(Nmea_t* nmea_data, LctFs_t* result, FILE* fp_gps);
|
2022-10-07 23:49:43 +08:00
|
|
|
|
|
|
|
|
|
/**----------------------------------------------------------------------
|
2022-10-15 16:07:19 +08:00
|
|
|
|
* Function : GetPDRVersion
|
|
|
|
|
* Description : <EFBFBD><EFBFBD>ȡpdr<EFBFBD>汾<EFBFBD><EFBFBD>
|
|
|
|
|
* Date : 2022/10/15 logzhan
|
2022-10-07 23:49:43 +08:00
|
|
|
|
*---------------------------------------------------------------------**/
|
2022-10-15 16:07:19 +08:00
|
|
|
|
const char* GetPDRVersion(void);
|
2022-10-07 23:49:43 +08:00
|
|
|
|
|
|
|
|
|
/**----------------------------------------------------------------------
|
|
|
|
|
* Function : pdr_closeAlgorithm
|
|
|
|
|
* Description : <EFBFBD>ر<EFBFBD>PDR<EFBFBD>㷨,<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>Դ
|
|
|
|
|
* Date : 2020/8/3 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
|
|
|
|
void Algorithm_DeInit();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32 // <20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>win32<33><32><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>dll<6C>ӿڵ<D3BF><DAB5><EFBFBD>
|
|
|
|
|
|
|
|
|
|
/**----------------------------------------------------------------------
|
|
|
|
|
* Function : LibPDR_Init
|
|
|
|
|
* Description : <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>PDR<EFBFBD>㷨(DLL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
* Date : 2020/8/3 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
|
|
|
|
__declspec(dllexport) void LibPDR_Init();
|
|
|
|
|
|
|
|
|
|
/**----------------------------------------------------------------------
|
|
|
|
|
* Function : PDR_StepUpdateGPS
|
|
|
|
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPS<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>(DLL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
* Date : 2022/9/16 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
|
|
|
|
__declspec(dllexport) PosFusion LibPDR_StepUpdateGPS(int useGpsFlg);
|
|
|
|
|
|
|
|
|
|
/**----------------------------------------------------------------------
|
|
|
|
|
* Function : setSimulatorFileCsvPath
|
|
|
|
|
* Description : <EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>(DLL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
* Date : 2020/8/3 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
|
|
|
|
__declspec(dllexport) void setSimulatorFileCsvPath(char* path);
|
|
|
|
|
|
|
|
|
|
/**----------------------------------------------------------------------
|
|
|
|
|
* Function : LibPDR_DeInit
|
|
|
|
|
* Description : <EFBFBD>ر<EFBFBD>pdr<EFBFBD>㷨<EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ棬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>dll<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(DLL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
* Date : 2020/8/3 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
|
|
|
|
__declspec(dllexport) void LibPDR_DeInit();
|
|
|
|
|
|
|
|
|
|
/**----------------------------------------------------------------------
|
|
|
|
|
* Function : setRefGpsYaw
|
|
|
|
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPS<EFBFBD>ο<EFBFBD><EFBFBD>Ƕ<EFBFBD>
|
|
|
|
|
* Date : 2020/8/3 logzhan
|
|
|
|
|
*---------------------------------------------------------------------**/
|
|
|
|
|
__declspec(dllexport) void setRefGpsYaw();
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|