PDR/1.Software/PDR 1.02/include/pdr_api.h

157 lines
5.7 KiB
C
Raw Normal View History

2022-09-15 16:35:25 +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 "pdr_util.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 ------------------------------------------------------*/
/**---------------------------------------------------------------------
* Function : pdr_algorithmInit
* 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>
* Date : 2020/7/3 logzhan
*---------------------------------------------------------------------**/
void Algorithm_Init(void);
/**---------------------------------------------------------------------
* Function : pdr_locationMainLoop
* 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-09-17 01:12:48 +08:00
int LocationMainLoop(imu* ImuData, lct_nmea* NmeaData, lct_fs* LocFusion,
2022-09-15 16:35:25 +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-09-17 01:12:48 +08:00
int ParseLineAndUpdate(char* line, lct_fs* result);
2022-09-15 16:35:25 +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
*---------------------------------------------------------------------**/
void RMC_Init(lct_nmea_rmc * rmc);
/**---------------------------------------------------------------------
* 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
*---------------------------------------------------------------------**/
void NmeaFlag_Init(lct_nmea * ln);
/**---------------------------------------------------------------------
* Function : clearNmeaFlg
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Nmea<EFBFBD><EFBFBD>־λ,<EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD>init<EFBFBD><EFBFBD>ͬ
* Date : 2020/7/4 logzhan
*---------------------------------------------------------------------**/
2022-09-17 01:12:48 +08:00
void ClearNmeaFlg(lct_nmea * ln);
2022-09-15 16:35:25 +08:00
/**---------------------------------------------------------------------
* Function : pdr_saveGnssInfo
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPS<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
* Date : 2020/7/3 logzhan
*---------------------------------------------------------------------**/
2022-09-17 01:12:48 +08:00
void SaveGnssInfo(lct_nmea* nmea_data, lct_fs* result, FILE* fp_gps);
2022-09-15 16:35:25 +08:00
/**----------------------------------------------------------------------
2022-09-17 01:12:48 +08:00
* Function : GetLIBVersion
2022-09-15 16:35:25 +08:00
* Description : pdr<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* Date : 2020/8/3 logzhan
*---------------------------------------------------------------------**/
2022-09-17 01:12:48 +08:00
const char* GetLIBVersion(void);
2022-09-15 16:35:25 +08:00
/**----------------------------------------------------------------------
* Function : pdr_closeAlgorithm
* Description : <EFBFBD>ر<EFBFBD>PDR<EFBFBD>,<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>Դ
* Date : 2020/8/3 logzhan
*---------------------------------------------------------------------**/
2022-09-17 01:12:48 +08:00
void Algorithm_DeInit();
2022-09-15 16:35:25 +08:00
#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();
/**----------------------------------------------------------------------
2022-09-17 01:12:48 +08:00
* Function : PDR_StepUpdateGPS
2022-09-15 16:35:25 +08:00
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPS<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>(DLL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
2022-09-17 01:12:48 +08:00
* Date : 2022/9/16 logzhan
2022-09-15 16:35:25 +08:00
*---------------------------------------------------------------------**/
2022-09-17 01:12:48 +08:00
__declspec(dllexport) PosFusion LibPDR_StepUpdateGPS(int useGpsFlg);
2022-09-15 16:35:25 +08:00
/**----------------------------------------------------------------------
* 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);
/**----------------------------------------------------------------------
2022-09-17 01:12:48 +08:00
* Function : LibPDR_DeInit
2022-09-15 16:35:25 +08:00
* 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
*---------------------------------------------------------------------**/
2022-09-17 01:12:48 +08:00
__declspec(dllexport) void LibPDR_DeInit();
2022-09-15 16:35:25 +08:00
/**----------------------------------------------------------------------
* 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