157 lines
5.6 KiB
C
157 lines
5.6 KiB
C
/******************** (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 对外部接口
|
||
********************************************************************************/
|
||
#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 ------------------------------------------------------*/
|
||
|
||
/**---------------------------------------------------------------------
|
||
* Function : Algorithm_Init
|
||
* Description : PDR算法主初始化流程,包括PDR导航初始化、计步器状态初始化以及轨
|
||
* 迹平滑窗口的初始化
|
||
* Date : 2022/10/15 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
void Algorithm_Init(void);
|
||
|
||
/**---------------------------------------------------------------------
|
||
* Function : LocationMainLoop
|
||
* Description : PDR定位主循环,主要处理来自上层输入的传感器数据并解算位置
|
||
* 迹平滑窗口的初始化
|
||
* Input : ss_data, 传感器数据
|
||
nmea_data, NMEA数据
|
||
result,定位结果
|
||
* Output : int, 输出标志位
|
||
* Date : 2020/7/3 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
int LocationMainLoop(IMU_t* ImuData, Nmea_t* NmeaData, LctFs_t* LocFusion,
|
||
FILE *fp_gps);
|
||
|
||
/**---------------------------------------------------------------------
|
||
* Function : pdr_locationMainLoopStr
|
||
* Description : PDR定位主循环,主要处理来自上层输入的传感器数据并解算位置
|
||
* 迹平滑窗口的初始化
|
||
* Date : 2020/07/03 logzhan
|
||
* 2020/02/02 logzhan : 增加宏控制是否开启输出平滑
|
||
*---------------------------------------------------------------------**/
|
||
int ParseLineAndUpdate(char* line, LctFs_t* result);
|
||
|
||
/**---------------------------------------------------------------------
|
||
* Function : pdr_initRmc
|
||
* Description : 初始化RMC结构体
|
||
* Input : rmc, RMC结构体
|
||
* Date : 2020/7/3 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
void RMC_Init(NmeaRMC_t * rmc);
|
||
|
||
/**---------------------------------------------------------------------
|
||
* Function : pdr_initNmeaFlg
|
||
* Description : 初始化GPS的NMEA协议的相关标志位
|
||
* Input : ln, NMEA结构体
|
||
* Date : 2020/7/3 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
void NmeaFlag_Init(Nmea_t * ln);
|
||
|
||
/**---------------------------------------------------------------------
|
||
* Function : clearNmeaFlg
|
||
* Description : 清空Nmea标志位,功能和init相同
|
||
* Date : 2020/7/4 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
void ClearNmeaFlg(Nmea_t * ln);
|
||
|
||
/**---------------------------------------------------------------------
|
||
* Function : pdr_saveGnssInfo
|
||
* Description : 保存GPS相关信息
|
||
* Date : 2020/7/3 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
void SaveGnssInfo(Nmea_t* nmea_data, LctFs_t* result, FILE* fp_gps);
|
||
|
||
/**----------------------------------------------------------------------
|
||
* Function : GetPDRVersion
|
||
* Description : 获取pdr版本号
|
||
* Date : 2022/10/15 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
const char* GetPDRVersion(void);
|
||
|
||
/**----------------------------------------------------------------------
|
||
* Function : pdr_closeAlgorithm
|
||
* Description : 关闭PDR算法,释放资源
|
||
* Date : 2020/8/3 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
void Algorithm_DeInit();
|
||
|
||
|
||
#ifdef _WIN32 // 主要用于支持win32调试使用,用于dll接口导出
|
||
|
||
/**----------------------------------------------------------------------
|
||
* Function : LibPDR_Init
|
||
* Description : 初始化PDR算法(DLL调用)
|
||
* Date : 2020/8/3 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
__declspec(dllexport) void LibPDR_Init();
|
||
|
||
/**----------------------------------------------------------------------
|
||
* Function : PDR_StepUpdateGPS
|
||
* Description : 仿真器按照GPS单步执行(DLL调用)
|
||
* Date : 2022/9/16 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
__declspec(dllexport) PosFusion LibPDR_StepUpdateGPS(int useGpsFlg);
|
||
|
||
/**----------------------------------------------------------------------
|
||
* Function : setSimulatorFileCsvPath
|
||
* Description : 设置仿真文件的路径(DLL调用)
|
||
* Date : 2020/8/3 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
__declspec(dllexport) void setSimulatorFileCsvPath(char* path);
|
||
|
||
/**----------------------------------------------------------------------
|
||
* Function : LibPDR_DeInit
|
||
* Description : 关闭pdr算法,释放相关内存,用于dll调用(DLL调用)
|
||
* Date : 2020/8/3 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
__declspec(dllexport) void LibPDR_DeInit();
|
||
|
||
/**----------------------------------------------------------------------
|
||
* Function : setRefGpsYaw
|
||
* Description : 设置GPS参考角度
|
||
* Date : 2020/8/3 logzhan
|
||
*---------------------------------------------------------------------**/
|
||
__declspec(dllexport) void setRefGpsYaw();
|
||
|
||
#endif
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
|
||
#endif
|