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

152 lines
5.5 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 "PDRBase.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 : PDRLocationMainLoop
* Description : PDR定位主循环主要处理来自上层输入的传感器数据并解算位置
* 迹平滑窗口的初始化
* Date : 2022/10/16 logzhan
*---------------------------------------------------------------------**/
int PDRLocationMainLoop(IMU_t* ImuData, Nmea_t* NmeaData, LctFs_t* LocFusion);
/**---------------------------------------------------------------------
* Function : pdr_locationMainLoopStr
* Description : PDR定位主循环主要处理来自上层输入的传感器数据并解算位置
* 迹平滑窗口的初始化
* Date : 2020/07/03 logzhan
* 2020/02/02 logzhan : 增加宏控制是否开启输出平滑
*---------------------------------------------------------------------**/
int ParseDataAndUpdate(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