78 lines
2.7 KiB
C++
78 lines
2.7 KiB
C++
|
/******************** (C) COPYRIGHT 2022 Geek************************************
|
|||
|
* File Name : Interface.c
|
|||
|
* Current Version : V2.0
|
|||
|
* Author : logzhan
|
|||
|
* Date of Issued : 2022.10.15
|
|||
|
* Comments : PDR<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㷨<EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD>ӿ<EFBFBD>
|
|||
|
********************************************************************************/
|
|||
|
#include "Interface.h"
|
|||
|
#include "Location.h"
|
|||
|
|
|||
|
/* Global Variable Definition ------------------------------------------------*/
|
|||
|
const char* PDR_Version = "2.0";
|
|||
|
Nmea_t Nmea;
|
|||
|
IMU_t Imu;
|
|||
|
/* Extern Variable Definition ------------------------------------------------*/
|
|||
|
extern EKFPara_t EkfPara;
|
|||
|
|
|||
|
/**---------------------------------------------------------------------
|
|||
|
* Function : ParseDataAndUpdate
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Date : 2022/10/16 logzhan
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
int ParseDataAndUpdate(char* line, LctFs_t* LocFusion)
|
|||
|
{
|
|||
|
// <20><><EFBFBD><EFBFBD>Gnss<73><73>Imu<6D><75><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PDR<44><52><EFBFBD><EFBFBD>
|
|||
|
//ParseGnssInsData(line, &Imu, &Nmea);
|
|||
|
// <20><><EFBFBD><EFBFBD>Imu<6D><75>Nmea<65>ṹ<EFBFBD>壬<EFBFBD><E5A3AC><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>λ<EFBFBD><CEBB>
|
|||
|
return PDRLocationMainLoop(&Imu, &Nmea, LocFusion);
|
|||
|
}
|
|||
|
|
|||
|
/**---------------------------------------------------------------------
|
|||
|
* Function : PDRLocationMainLoop
|
|||
|
* Description : PDR<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD>
|
|||
|
* Date : 2022/11/1 logzhan
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
int PDRLocationMainLoop(IMU_t* imu, Nmea_t* nmea, LctFs_t* LocFusion) {
|
|||
|
int type = 0;
|
|||
|
|
|||
|
if (imu->gyr.update) {
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ù<EFBFBD><C3B9>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
InsLocationUpdate(imu, &EkfPara);
|
|||
|
imu->gyr.update = NO_UPDATE;
|
|||
|
}
|
|||
|
// <20><><EFBFBD><EFBFBD>GPS<50><53><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if (!nmea->Update)return TYPE_FIX_NONE;
|
|||
|
|
|||
|
// дGPS<50><53><EFBFBD><EFBFBD>LOG<4F><47>Ϣ
|
|||
|
//SaveGnssInfo(nmea, LocFusion, NULL);
|
|||
|
|
|||
|
// <20><>GPS<50><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPS<50>ں϶<DABA>λ
|
|||
|
//int flag = GnssInsFusionLocation(nmea, &g_kfPara, LocFusion);
|
|||
|
|
|||
|
//if (flag != TYPE_FIX_NONE) {
|
|||
|
// // <20><><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPS<50><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// LocFusion->latitude = R2D(LocFusion->latitude);
|
|||
|
// LocFusion->longitudinal = R2D(LocFusion->longitudinal);
|
|||
|
|
|||
|
// LocFusion->last_lat = LocFusion->latitude;
|
|||
|
// LocFusion->last_lon = LocFusion->longitudinal;
|
|||
|
// type = 1;
|
|||
|
//}
|
|||
|
//else if (LocFusion->last_lat != 0.0 && LocFusion->last_lon != 0.0) {
|
|||
|
// LocFusion->latitude = LocFusion->last_lat;
|
|||
|
// LocFusion->longitudinal = LocFusion->last_lon;
|
|||
|
// type = 1;
|
|||
|
//}
|
|||
|
//ClearNmeaFlg(nmea);
|
|||
|
return type;
|
|||
|
}
|
|||
|
|
|||
|
/**----------------------------------------------------------------------
|
|||
|
* Function : GetPDRVersion
|
|||
|
* Description : <EFBFBD><EFBFBD>ȡpdr<EFBFBD>汾<EFBFBD><EFBFBD>
|
|||
|
* Date : 2022/10/15 logzhan
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
const char* GetPDRVersion(void) {
|
|||
|
return PDR_Version;
|
|||
|
}
|