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

157 lines
5.7 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/******************** (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 : 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 LocationMainLoop(IMU_t* ImuData, lct_nmea* NmeaData, lct_fs* LocFusion,
FILE *fp_gps);
/**---------------------------------------------------------------------
* Function : pdr_locationMainLoopStr
* Description : PDR定位主循环主要处理来自上层输入的传感器数据并解算位置
* 迹平滑窗口的初始化
* Date : 2020/07/03 logzhan
* 2020/02/02 logzhan : 增加宏控制是否开启输出平滑
*---------------------------------------------------------------------**/
int ParseLineAndUpdate(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 SaveGnssInfo(lct_nmea* nmea_data, lct_fs* result, FILE* fp_gps);
/**----------------------------------------------------------------------
* Function : GetLIBVersion
* Description : pdr库版本号
* Date : 2020/8/3 logzhan
*---------------------------------------------------------------------**/
const char* GetLIBVersion(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