|
@@ -16,6 +16,8 @@
|
|
|
#include "decition.pb.h"
|
|
|
#include "chassis.pb.h"
|
|
|
|
|
|
+#include "torquebrake.h"
|
|
|
+
|
|
|
#include <thread>
|
|
|
|
|
|
void * gpacansend;
|
|
@@ -97,6 +99,28 @@ void executeDecition(const iv::brain::decition decition)
|
|
|
gcontroller->control_turnsignals(decition.leftlamp(),decition.rightlamp());
|
|
|
gcontroller->control_door(decition.door());
|
|
|
|
|
|
+#ifdef TORQUEBRAKETEST
|
|
|
+ if(gnothavetb < 10)
|
|
|
+ {
|
|
|
+ iv::controller::torquebrake xtb;
|
|
|
+ gMutextb.lock();
|
|
|
+ xtb.CopyFrom(gtb);
|
|
|
+ gMutextb.unlock();
|
|
|
+ if(xtb.enable())
|
|
|
+ {
|
|
|
+ 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
|
|
|
+
|
|
|
/*if(decition.has_door())
|
|
|
{
|
|
|
if(decition.door())
|
|
@@ -298,6 +322,10 @@ int main(int argc, char *argv[])
|
|
|
gpadecition = iv::modulecomm::RegisterRecv(gstrmemdecition.data(),ListenDeciton);
|
|
|
gpachassis = iv::modulecomm::RegisterRecv(gstrmemchassis.data(),UpdateChassis);
|
|
|
|
|
|
+#ifdef TORQUEBRAKETEST
|
|
|
+ EnableTorqueBrakeTest();
|
|
|
+#endif
|
|
|
+
|
|
|
std::thread xthread(sendthread);
|
|
|
|
|
|
return a.exec();
|