|
@@ -202,12 +202,48 @@ void executeDecition(const iv::brain::decition &decition)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ static int nlreq = 0;
|
|
|
|
+ static int nrreq = 0;
|
|
if(decition.leftlamp() == true && decition.rightlamp() == false)
|
|
if(decition.leftlamp() == true && decition.rightlamp() == false)
|
|
|
|
+ {
|
|
SetMsgSignal("ECU_30A","ADS_UDLCTurnLightReq",3.0);
|
|
SetMsgSignal("ECU_30A","ADS_UDLCTurnLightReq",3.0);
|
|
- else if(decition.leftlamp() == false && decition.rightlamp() == true)
|
|
|
|
- SetMsgSignal("ECU_30A","ADS_UDLCTurnLightReq",4.0);
|
|
|
|
|
|
+ nlreq = 30;
|
|
|
|
+ nrreq = 0;
|
|
|
|
+ }
|
|
else
|
|
else
|
|
- SetMsgSignal("ECU_30A","ADS_UDLCTurnLightReq",0.0);
|
|
|
|
|
|
+ {
|
|
|
|
+ if(decition.leftlamp() == false && decition.rightlamp() == true)
|
|
|
|
+ {
|
|
|
|
+ SetMsgSignal("ECU_30A","ADS_UDLCTurnLightReq",4.0);
|
|
|
|
+ nrreq = 30;
|
|
|
|
+ nlreq = 0;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if((nlreq == 0) && (nrreq == 0))
|
|
|
|
+ {
|
|
|
|
+ SetMsgSignal("ECU_30A","ADS_UDLCTurnLightReq",0.0);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if(nlreq > 0)
|
|
|
|
+ {
|
|
|
|
+ nlreq--;
|
|
|
|
+ SetMsgSignal("ECU_30A","ADS_UDLCTurnLightReq",1.0);
|
|
|
|
+ // std::cout<<"turn off left."<<std::endl;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ nrreq--;
|
|
|
|
+ SetMsgSignal("ECU_30A","ADS_UDLCTurnLightReq",2.0);
|
|
|
|
+ std::cout<<" set light off"<<std::endl;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -509,7 +545,7 @@ void ExecSend()
|
|
pxrawB2->CopyFrom(xraw);
|
|
pxrawB2->CopyFrom(xraw);
|
|
|
|
|
|
int64_t nnow = std::chrono::system_clock::now().time_since_epoch().count();
|
|
int64_t nnow = std::chrono::system_clock::now().time_since_epoch().count();
|
|
- if((nnow - gnchronodecitionext)<1000)
|
|
|
|
|
|
+ if((nnow - gnchronodecitionext)<1e9)
|
|
{
|
|
{
|
|
if(gbdecitionextupdate)
|
|
if(gbdecitionextupdate)
|
|
{
|
|
{
|
|
@@ -529,6 +565,8 @@ void ExecSend()
|
|
iv::can::canraw * pxraw2CA = xmsg.add_rawmsg();
|
|
iv::can::canraw * pxraw2CA = xmsg.add_rawmsg();
|
|
pxraw2CA->CopyFrom(xraw);
|
|
pxraw2CA->CopyFrom(xraw);
|
|
|
|
|
|
|
|
+ std::cout<<" send 2ca."<<std::endl;
|
|
|
|
+
|
|
gbdecitionextupdate = false;
|
|
gbdecitionextupdate = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -556,6 +594,8 @@ void ExecSend()
|
|
std::cout<<"ExecSend serialize error."<<std::endl;
|
|
std::cout<<"ExecSend serialize error."<<std::endl;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// std::cout<<" send can."<<std::endl;
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|