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