|
@@ -135,6 +135,9 @@ void ExecSend();
|
|
void executeDecition(const iv::brain::decition &decition)
|
|
void executeDecition(const iv::brain::decition &decition)
|
|
{
|
|
{
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
static int xieya = 50;
|
|
static int xieya = 50;
|
|
// std::cout<<"acc is "<<decition.torque()<<" ang is "<<decition.wheelangle()<<std::endl;
|
|
// std::cout<<"acc is "<<decition.torque()<<" ang is "<<decition.wheelangle()<<std::endl;
|
|
// std::cout<<"angle_mode is "<<decition.angle_mode()<<" angle_active is "<<decition.angle_active()<<std::endl;
|
|
// std::cout<<"angle_mode is "<<decition.angle_mode()<<" angle_active is "<<decition.angle_active()<<std::endl;
|
|
@@ -157,7 +160,7 @@ void executeDecition(const iv::brain::decition &decition)
|
|
|
|
|
|
// }
|
|
// }
|
|
|
|
|
|
- std::cout<<" wheel req: "<<decition.wheelangle()<<" real send : "<<fWheelAngleReq<<" real whhel:"<<gfWheelAngle<< std::endl;
|
|
|
|
|
|
+// std::cout<<" wheel req: "<<decition.wheelangle()<<" real send : "<<fWheelAngleReq<<" real whhel:"<<gfWheelAngle<< std::endl;
|
|
|
|
|
|
_m1C4.ACC_LatAngReq = ECU_1C4_ACC_LatAngReq_toS(fWheelAngleReq);
|
|
_m1C4.ACC_LatAngReq = ECU_1C4_ACC_LatAngReq_toS(fWheelAngleReq);
|
|
//_m1C4.ADS_Reqmode = decition.angle_mode(); //20221102,新车没有此信号
|
|
//_m1C4.ADS_Reqmode = decition.angle_mode(); //20221102,新车没有此信号
|
|
@@ -464,6 +467,8 @@ void ListenDeciton(const char * strdata,const unsigned int nSize,const unsigned
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
// if(xdecition.gear() != 4)
|
|
// if(xdecition.gear() != 4)
|
|
// {
|
|
// {
|
|
// qDebug("not D");
|
|
// qDebug("not D");
|
|
@@ -594,6 +599,34 @@ void sendthread()
|
|
gMutex.unlock();
|
|
gMutex.unlock();
|
|
gnDecitionNum--;
|
|
gnDecitionNum--;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+#ifdef TORQUEBRAKETEST
|
|
|
|
+ if(gnothavetb < 10)
|
|
|
|
+ {
|
|
|
|
+ iv::controller::torquebrake xtb;
|
|
|
|
+ gMutextb.lock();
|
|
|
|
+ xtb.CopyFrom(gtb);
|
|
|
|
+ gMutextb.unlock();
|
|
|
|
+ if(xtb.enable())
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ xdecition.set_torque(xtb.torque());
|
|
|
|
+ xdecition.set_brake(xtb.brake());
|
|
|
|
+
|
|
|
|
+ std::cout<<" use xtb. torque: "<<xtb.torque()<<" brake: "<<xtb.brake()<<std::endl;
|
|
|
|
+
|
|
|
|
+// gcontroller->control_torque(xtb.torque());
|
|
|
|
+// gcontroller->control_brake(xtb.brake());
|
|
|
|
+ // qDebug("use tb value torque is %f brake is %f",xtb.torque(),xtb.brake());
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ // qDebug("torquebrake not enable.");
|
|
|
|
+ }
|
|
|
|
+ gnothavetb++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+#endif
|
|
executeDecition(xdecition);
|
|
executeDecition(xdecition);
|
|
if(gbChassisEPS == false) ExecSend();
|
|
if(gbChassisEPS == false) ExecSend();
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|