|
@@ -368,12 +368,17 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
|
|
|
mpachassis = iv::modulecomm::RegisterRecvPlus("chassis",funchassis);
|
|
|
|
|
|
mpacanstate = iv::modulecomm::RegisterRecv("canstate",ListenCANState);
|
|
|
- gIvlog->debug("canState ptr: %x",mpacanstate);
|
|
|
+// gIvlog->debug("canState ptr: %x",mpacanstate);
|
|
|
+
|
|
|
|
|
|
ModuleFun funbrainstate =std::bind(&ADCIntelligentVehicle::UpdateVehicleState,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
// mpaVechicleState = iv::modulecomm::RegisterRecvPlus("vehiclestate",funbrainstate);
|
|
|
mpaVechicleState = iv::modulecomm::RegisterRecvPlus("brainstate",funbrainstate);
|
|
|
|
|
|
+ ModuleFun funbrainrunstate =std::bind(&ADCIntelligentVehicle::UpdateBrainRunState,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
+ // mpaVechicleState = iv::modulecomm::RegisterRecvPlus("vehiclestate",funbrainstate);
|
|
|
+ void * parun = iv::modulecomm::RegisterRecvPlus("brainrunstate",funbrainrunstate);
|
|
|
+
|
|
|
ModuleFun fundecition =std::bind(&ADCIntelligentVehicle::UpdateDecition,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
|
|
|
// mpaDecition = iv::modulecomm::RegisterRecvPlus("decition",fundecition);
|
|
@@ -1942,7 +1947,8 @@ void ADCIntelligentVehicle::UpdateGPSIMU(const char * strdata,const unsigned int
|
|
|
|
|
|
ServiceCarStatus.speed = data->speed;
|
|
|
|
|
|
- std::cout<<" speed : "<<ServiceCarStatus.speed;
|
|
|
+// std::cout<<"chrono: "<<std::chrono::system_clock::now().time_since_epoch().count()/1000000<<std::endl;
|
|
|
+// std::cout<<" speed : "<<ServiceCarStatus.speed;
|
|
|
|
|
|
ServiceCarStatus.location->gps_lat = data->gps_lat;
|
|
|
ServiceCarStatus.location->gps_lng = data->gps_lng;
|
|
@@ -2074,6 +2080,18 @@ void ADCIntelligentVehicle::UpdateDecition(const char * strdata,const unsigned i
|
|
|
mnTimeUpdateDecition = mTimeState.elapsed();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+void ADCIntelligentVehicle::UpdateBrainRunState(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
|
|
|
+{
|
|
|
+ iv::brain::brainrunstate xbrainstate;
|
|
|
+ if(!xbrainstate.ParseFromArray(strdata,nSize))
|
|
|
+ {
|
|
|
+ gIvlog->warn("ADCIntelligentVehicle::UpdateVehicleState parse error,nSize is %d ",nSize);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ mdecition_period = xbrainstate.decision_period();
|
|
|
+ qDebug("period: %f ",mdecition_period);
|
|
|
+}
|
|
|
/**
|
|
|
* @brief ADCIntelligentVehicle::UpdateVehicleState
|
|
|
* @param strdata
|
|
@@ -2096,7 +2114,8 @@ void ADCIntelligentVehicle::UpdateVehicleState(const char * strdata,const unsign
|
|
|
ServiceCarStatus.mRadarObs = xbrainstate.mfradarobs();
|
|
|
mbBrainRunning = xbrainstate.mbbrainrunning();
|
|
|
ServiceCarStatus.mbBrainCtring = xbrainstate.mbbrainrunning();
|
|
|
- mdecition_period = xbrainstate.decision_period();
|
|
|
+// mdecition_period = xbrainstate.decision_period();
|
|
|
+// qDebug("period: %f ",mdecition_period);
|
|
|
|
|
|
mnTimeUpdateVS = mTimeState.elapsed();
|
|
|
}
|