|
@@ -68,7 +68,11 @@ namespace decition {
|
|
|
{
|
|
|
gbrain->GetFusion(strdata,nSize);
|
|
|
}
|
|
|
- }
|
|
|
+ void ListenTrafficSign(const char *strdata, const unsigned int nSize, const unsigned int index, const QDateTime *dt, const char *strmemname) //20230814,交通标志牌识别数据更新
|
|
|
+ {
|
|
|
+ gbrain->GetTrafficSign(strdata,nSize);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
}
|
|
|
|
|
@@ -115,6 +119,9 @@ iv::decition::BrainDecition::BrainDecition()
|
|
|
|
|
|
mpv2r = iv::modulecomm::RegisterRecv("v2r_send",iv::decition::ListenV2r); //20211009,cxw
|
|
|
|
|
|
+ mpaTrafficSign = iv::modulecomm::RegisterRecv("signarray",iv::decition::ListenTrafficSign); //20230814,交通标志牌识别数据更新
|
|
|
+
|
|
|
+
|
|
|
ModuleFun funchassis =std::bind(&iv::decition::BrainDecition::UpdateChassis,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
mpaChassis = iv::modulecomm::RegisterRecvPlus(gstrmemchassis.data(),funchassis);
|
|
|
|
|
@@ -150,6 +157,8 @@ iv::decition::BrainDecition::~BrainDecition()
|
|
|
iv::modulecomm::Unregister(mpaVechicleState);
|
|
|
iv::modulecomm::Unregister(mpvbox);
|
|
|
iv::modulecomm::Unregister(mpa);
|
|
|
+ iv::modulecomm::Unregister(mpaTrafficSign);
|
|
|
+ iv::modulecomm::Unregister(mpv2r);
|
|
|
|
|
|
delete eyes;
|
|
|
std::cout<<"Brain Unialize."<<std::endl;
|
|
@@ -1172,6 +1181,88 @@ void iv::decition::BrainDecition::UpdateFusion(std::shared_ptr<iv::fusion::fusio
|
|
|
|
|
|
}
|
|
|
|
|
|
+//20230814,交通标志识别
|
|
|
+void iv::decition::BrainDecition::GetTrafficSign(const char *pdata, const int ndatasize)
|
|
|
+{
|
|
|
+ std::shared_ptr<iv::vision::cameraobjectarray> xtrafficsign (new iv::vision::cameraobjectarray);
|
|
|
+
|
|
|
+ if(ndatasize<1)return;
|
|
|
+
|
|
|
+ if(false == xtrafficsign->ParseFromArray(pdata,ndatasize))
|
|
|
+ {
|
|
|
+ std::cout<<" Listen traffic sign fail."<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ //std::cout<<"srfront byte size: "<<radarobjvec.ByteSize()<<std::endl;
|
|
|
+ }
|
|
|
+
|
|
|
+ ServiceCarStatus.mTrafficSignUpdateTimer.start();
|
|
|
+ ServiceCarStatus.iTrafficsignSpeed=200.0;
|
|
|
+ ServiceCarStatus.itrafficsignTurn=200.0;
|
|
|
+
|
|
|
+ iv::decition::BrainDecition::UpdateTrafficSign(xtrafficsign);
|
|
|
+}
|
|
|
+
|
|
|
+void iv::decition::BrainDecition::UpdateTrafficSign(std::shared_ptr<iv::vision::cameraobjectarray> xtrafficsign)
|
|
|
+{
|
|
|
+ mMutexVison_.lock();
|
|
|
+
|
|
|
+ xtrafficsign.swap(mvision_obs_);
|
|
|
+ int flag;
|
|
|
+ for(int i =0; i<mvision_obs_->obj_size();i++)//{"Speed10","Speed5","Left","Right","Nopassing","Park"}共六类
|
|
|
+ {
|
|
|
+ if(mvision_obs_->obj(i).type()=="Speed10")
|
|
|
+ flag=0;
|
|
|
+ else if(mvision_obs_->obj(i).type()=="Speed5")
|
|
|
+ flag=1;
|
|
|
+ else if(mvision_obs_->obj(i).type()=="Left")
|
|
|
+ flag=2;
|
|
|
+ else if(mvision_obs_->obj(i).type()=="Right")
|
|
|
+ flag=3;
|
|
|
+ else if(mvision_obs_->obj(i).type()=="Nopassing")
|
|
|
+ flag=4;
|
|
|
+ else if(mvision_obs_->obj(i).type()=="Park")
|
|
|
+ flag=5;
|
|
|
+ else
|
|
|
+ flag =200;
|
|
|
+
|
|
|
+ if((flag==0) ||(flag==1)||(flag==4)|(flag==5))
|
|
|
+ {
|
|
|
+ switch(flag)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ ServiceCarStatus.iTrafficsignSpeed=min(10.0 , ServiceCarStatus.iTrafficsignSpeed);
|
|
|
+ case 1:
|
|
|
+ ServiceCarStatus.iTrafficsignSpeed=min(5.0,ServiceCarStatus.iTrafficsignSpeed);
|
|
|
+ case 4:
|
|
|
+ ServiceCarStatus.iTrafficsignSpeed=min(0.0,ServiceCarStatus.iTrafficsignSpeed);
|
|
|
+ case 5:
|
|
|
+ ServiceCarStatus.iTrafficsignSpeed=min(0.0,ServiceCarStatus.iTrafficsignSpeed);
|
|
|
+ default:
|
|
|
+ ServiceCarStatus.iTrafficsignSpeed=200.0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if((flag==2) ||(flag==3))
|
|
|
+ {
|
|
|
+ switch(flag)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ ServiceCarStatus.itrafficsignTurn=2;
|
|
|
+ case 3:
|
|
|
+ ServiceCarStatus.itrafficsignTurn=3;
|
|
|
+ default:
|
|
|
+ ServiceCarStatus.itrafficsignTurn=200.0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ givlog->debug("decition_brain","flag is : %d",flag);
|
|
|
+ givlog->debug("decition_brain","itrafficsignTurn is : %d",ServiceCarStatus.itrafficsignTurn);
|
|
|
+ givlog->debug("decition_brain","iTrafficsignSpeed is : %f",ServiceCarStatus.iTrafficsignSpeed);
|
|
|
+
|
|
|
+ mMutexVison_.unlock();
|
|
|
+}
|
|
|
|
|
|
void iv::decition::BrainDecition::UpdateGroupInfo(const char *pdata, const int ndatasize){
|
|
|
|