Przeglądaj źródła

yuhesen dipanche tiaoshi

fujiankuan 4 lat temu
rodzic
commit
46d4d24ca7

+ 5 - 5
src/controller/controller_yuhesen/main.cpp

@@ -58,7 +58,7 @@ void executeDecition(const iv::brain::decition decition)
     std::cout<<" brake is "<<decition.brake()<<std::endl;
     std::cout<<"drive_mode is "<<decition.mode()<<std::endl;
     std::cout<<" dangwei is "<<decition.gear()<<std::endl;
-    std::cout<<"dspeed is" << decition.speed()<<std::endl;
+    std::cout<<"dspeed is " << decition.speed()<<std::endl;
     gcontroller->inialize();
     gcontroller->control_wheel(decition.wheelangle());
     gcontroller->control_brake(decition.brake());
@@ -207,14 +207,14 @@ int main(int argc, char *argv[])
      QString strpath = QCoreApplication::applicationDirPath();
 
     if(argc < 2)
-        strpath = strpath + "/controller_midcar.xml";
+        strpath = strpath + "/controller_yuhesen.xml";
     else
         strpath = argv[1];
     std::cout<<strpath.toStdString()<<std::endl;
 
-    gdecition_def.set_brake(0);
-    gdecition_def.set_torque(0);
-    gdecition_def.set_speed(105);
+//    gdecition_def.set_brake(0);
+//    gdecition_def.set_torque(0);
+//    gdecition_def.set_speed(105);
     gTime.start();
 
     gcontroller = boost::shared_ptr<iv::control::Controller>(new iv::control::Controller());

+ 4 - 1
src/decition/decition_brain/decition/adc_adapter/yuhesen_adapter.cpp

@@ -89,12 +89,15 @@ std::cout<<"==========================================="<<std::endl;
      std::cout<<"dSpeed:"<<dSpeed<<"   realSpeed:"<<realSpeed<<"   acc:"<<accAim
     <<std::endl;
 std::cout<<"========================================="<<std::endl;
-(*decition)->speed=5/3.6;
+(*decition)->speed = dSpeed/3.6;
 (*decition)->wheel_angle=(*decition)->wheel_angle*0.1;
 (*decition)->wheel_angle=max((float)-40.0,(*decition)->wheel_angle);
 (*decition)->wheel_angle=min((float)40.0,(*decition)->wheel_angle);
 (*decition)->mode=1;
 (*decition)->dangWei=1;
+if((*decition)->brake>0){
+    (*decition)->speed=0;
+}
     return *decition;
 }
 

+ 3 - 3
src/decition/decition_brain/decition/brain.cpp

@@ -1,4 +1,4 @@
-#include <decition/brain.h>
+ #include <decition/brain.h>
 #include <fstream>
 #include <time.h>
 #include <exception>
@@ -403,7 +403,7 @@ void iv::decition::BrainDecition::run() {
         ServiceCarStatus.useObsPredict = true;
     }
 
-    std::string inRoadAvoid = xp.GetParam("inRoadAvoid","true");  //If Use MPC set true
+    std::string inRoadAvoid = xp.GetParam("inRoadAvoid","false");  //If Use MPC set true
     if(inRoadAvoid == "true")
     {
         ServiceCarStatus.inRoadAvoid = true;
@@ -1024,7 +1024,7 @@ void iv::decition::BrainDecition::UpdateMap(const char *mapdata, const int mapda
         }
 
         mmpcapi.SetMAP(xvectorMAP);
-
+                                                                                                    
         if(ServiceCarStatus.speed_control==true){
         Compute00().getDesiredSpeed(navigation_data);}
         mMutexMap.unlock();

+ 1 - 1
src/decition/decition_brain_sf/decition/brain.cpp

@@ -372,7 +372,7 @@ void iv::decition::BrainDecition::run() {
     }
     //map
 
-    std::string inRoadAvoid = xp.GetParam("inRoadAvoid","true");  //If Use MPC set true
+    std::string inRoadAvoid = xp.GetParam("inRoadAvoid","false");  //If Use MPC set true
     if(inRoadAvoid == "true")
     {
         ServiceCarStatus.inRoadAvoid = true;