PDR/3.BackUp/PDR-Origin-Version/include/pdr_api.h

158 lines
5.9 KiB
C
Raw Permalink 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 VIVO************************************
* File Name : pdr_api.h
* Department : Sensor Algorithm Team
* Current Version : V2.0(compare QCOM SAP 5.0)
* Author : yuanlin_rjyb@vivo.com & zhanli@vivo.com
* 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 yuanlin_rjyb@vivo.com
*---------------------------------------------------------------------**/
void pdr_initAlgorithm(void);
/**---------------------------------------------------------------------
* Function : pdr_locationMainLoop
* Description : PDR定位主循环主要处理来自上层输入的传感器数据并解算位置
* 迹平滑窗口的初始化
* Input : ss_data 传感器数据
nmea_data, NMEA数据
result定位结果
* Output : int, 输出标志位
* Date : 2020/7/3 yuanlin_rjyb@vivo.com
*---------------------------------------------------------------------**/
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 yuanlin_rjyb@vivo.com
* 2020/02/02 zhanli@vivo.com : 增加宏控制是否开启输出平滑
*---------------------------------------------------------------------**/
int pdr_locationMainLoopStr(char* line, lct_fs* result);
/**---------------------------------------------------------------------
* Function : pdr_initRmc
* Description : 初始化RMC结构体
* Input : rmc RMC结构体
* Date : 2020/7/3 yuanlin_rjyb@vivo.com
*---------------------------------------------------------------------**/
void pdr_initRmc(lct_nmea_rmc * rmc);
/**---------------------------------------------------------------------
* Function : pdr_initNmeaFlg
* Description : 初始化GPS的NMEA协议的相关标志位
* Input : ln NMEA结构体
* Date : 2020/7/3 yuanlin_rjyb@vivo.com
*---------------------------------------------------------------------**/
void pdr_initNmeaFlg(lct_nmea * ln);
/**---------------------------------------------------------------------
* Function : clearNmeaFlg
* Description : 清空Nmea标志位,功能和init相同
* Date : 2020/7/4 yuanlin_rjyb@vivo.com
*---------------------------------------------------------------------**/
void clearNmeaFlg(lct_nmea * ln);
/**---------------------------------------------------------------------
* Function : pdr_saveGnssInfo
* Description : 保存GPS相关信息
* Date : 2020/7/3 yuanlin_rjyb@vivo.com
*---------------------------------------------------------------------**/
void pdr_saveGnssInfo(lct_nmea* nmea_data, lct_fs* result, FILE* fp_gps);
/**----------------------------------------------------------------------
* Function : pdr_libVersion
* Description : pdr库版本号
* Date : 2020/8/3 zhanli@vivo.com
*---------------------------------------------------------------------**/
const char* pdr_libVersion(void);
/**----------------------------------------------------------------------
* Function : pdr_closeAlgorithm
* Description : 关闭PDR算法,释放资源
* Date : 2020/8/3 zhanli@vivo.com
*---------------------------------------------------------------------**/
void pdr_closeAlgorithm();
#ifdef _WIN32 // 主要用于支持win32调试使用用于dll接口导出
/**----------------------------------------------------------------------
* Function : initPdrAlgo
* Description : 初始化PDR算法(DLL调用)
* Date : 2020/8/3 zhanli@vivo.com
*---------------------------------------------------------------------**/
__declspec(dllexport) void initPdrAlgo();
/**----------------------------------------------------------------------
* Function : pdrSumulatorUpdateGpsStep
* Description : 仿真器按照GPS单步执行(DLL调用)
* Date : 2020/8/3 zhanli@vivo.com
*---------------------------------------------------------------------**/
__declspec(dllexport) PosFusion pdrSumulatorUpdateGpsStep(int useGpsFlg);
/**----------------------------------------------------------------------
* Function : setSimulatorFileCsvPath
* Description : 设置仿真文件的路径(DLL调用)
* Date : 2020/8/3 zhanli@vivo.com
*---------------------------------------------------------------------**/
__declspec(dllexport) void setSimulatorFileCsvPath(char* path);
/**----------------------------------------------------------------------
* Function : closePdrAlgo
* Description : 关闭pdr算法释放相关内存用于dll调用(DLL调用)
* Date : 2020/8/3 zhanli@vivo.com
*---------------------------------------------------------------------**/
__declspec(dllexport) void closePdrAlgo();
/**----------------------------------------------------------------------
* Function : setRefGpsYaw
* Description : 设置GPS参考角度
* Date : 2020/8/3 zhanli@vivo.com
*---------------------------------------------------------------------**/
__declspec(dllexport) void setRefGpsYaw();
#endif
#ifdef __cplusplus
}
#endif
#endif