|
@@ -356,6 +356,9 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
|
|
|
|
|
|
ModuleFun fungpsimu =std::bind(&ADCIntelligentVehicle::UpdateGPSIMU,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
mpagpsimu = iv::modulecomm::RegisterRecvPlus(gstrmemgps.data(),fungpsimu);
|
|
|
+
|
|
|
+ ModuleFun funfusiongpsimu =std::bind(&ADCIntelligentVehicle::UpdateGPSIMU,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
+ mpafusiongpsimu = iv::modulecomm::RegisterRecvPlus("fusion_gpsimu",funfusiongpsimu);
|
|
|
// mpagpsimu = iv::modulecomm::RegisterRecv("gpsimu",Listengpsimu);
|
|
|
|
|
|
ModuleFun funradar =std::bind(&ADCIntelligentVehicle::UpdateRADAR,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
@@ -1898,6 +1901,19 @@ void ADCIntelligentVehicle::UpdateGPSIMU(const char * strdata,const unsigned int
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if(strcmp(gstrmemgps.data(),strmemname) == 0)
|
|
|
+ {
|
|
|
+ int64_t nmsnow = std::chrono::system_clock::now().time_since_epoch().count()/1000000;
|
|
|
+ if(abs(nmsnow - mnLastFusionGPSIMUUpdate)<3000)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mnLastFusionGPSIMUUpdate = std::chrono::system_clock::now().time_since_epoch().count()/1000000;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
iv::GPSData data(new iv::GPS_INS);
|
|
@@ -1917,8 +1933,17 @@ void ADCIntelligentVehicle::UpdateGPSIMU(const char * strdata,const unsigned int
|
|
|
|
|
|
ServiceCarStatus.mRTKStatus = data->rtk_status;
|
|
|
|
|
|
+ if(xgpsimu.has_speed())
|
|
|
+ data->speed = xgpsimu.speed() *3.6;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ data->speed= sqrt(pow(data->vel_E,2)+pow(data->vel_N,2)) * 3.6;
|
|
|
+ }
|
|
|
+
|
|
|
ServiceCarStatus.speed = data->speed;
|
|
|
|
|
|
+ std::cout<<" speed : "<<ServiceCarStatus.speed;
|
|
|
+
|
|
|
ServiceCarStatus.location->gps_lat = data->gps_lat;
|
|
|
ServiceCarStatus.location->gps_lng = data->gps_lng;
|
|
|
ServiceCarStatus.location->ins_heading_angle = data->ins_heading_angle;
|
|
@@ -1927,7 +1952,7 @@ void ADCIntelligentVehicle::UpdateGPSIMU(const char * strdata,const unsigned int
|
|
|
ServiceCarStatus.location->rtk_status = data->rtk_status;
|
|
|
ServiceCarStatus.location->ins_status = data->ins_status;
|
|
|
|
|
|
- ServiceCarStatus.speed = sqrt(pow(data->vel_E,2)+pow(data->vel_N,2)) * 3.6; //double pow(double x, double y) 返回 x 的 y 次幂,即 xy。
|
|
|
+// ServiceCarStatus.speed = sqrt(pow(data->vel_E,2)+pow(data->vel_N,2)) * 3.6; //double pow(double x, double y) 返回 x 的 y 次幂,即 xy。
|
|
|
|
|
|
mnTimeUpdateGPS = mTimeState.elapsed();
|
|
|
}
|