Browse Source

change decition_brain_sf_changan_shenlan. change end brake distance from 1.2 to 0.3. brake is ok.

yuchuli 1 year ago
parent
commit
4f2bcc77d4

+ 34 - 1
src/controller/controller_changan_shenlan_v2/main.cpp

@@ -135,6 +135,9 @@ void ExecSend();
 void executeDecition(const iv::brain::decition &decition)
 {
 
+
+
+
     static int xieya = 50;
 //     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;
@@ -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.ADS_Reqmode = decition.angle_mode(); //20221102,新车没有此信号
@@ -464,6 +467,8 @@ void ListenDeciton(const char * strdata,const unsigned int nSize,const unsigned
         return;
     }
 
+
+
     //    if(xdecition.gear() != 4)
     //    {
     //        qDebug("not D");
@@ -594,6 +599,34 @@ void sendthread()
             gMutex.unlock();
             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);
         if(gbChassisEPS == false) ExecSend();
         std::this_thread::sleep_for(std::chrono::milliseconds(10));

+ 6 - 2
src/decition/decition_brain_sf_changan_shenlan/decition/decide_gps_00.cpp

@@ -1020,7 +1020,7 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
 //        }
 //    }
     int useaccend = 1;
-    double mstopbrake=0.3;
+    double mstopbrake=0.6;
     if(((ServiceCarStatus.table_look_up_on==true)&&(hapo_Adapter->IsINterpolationOK()))||(useaccend == 1))
     {
                 if(PathPoint+1000>gpsMapLine.size()){
@@ -1029,6 +1029,10 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
                     distoend=1000;
                 }
                 if(!circleMode && distoend<100){
+                        if(distoend<3.0)
+                        {
+                            std::cout<<"distoend:  "<<distoend<<std::endl;
+                        }
                         double nowspeed = realspeed/3.6;
                         double brakedis = 100;
                         double stopbrake = mstopbrake;
@@ -1047,7 +1051,7 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
                             if((acc_end<(-3.0))&&(nowspeed<10))acc_end = -3.0;
                         }
 
-                        if((distoend < 1.2)||(PathPoint>=gpsMapLine.size()-2))acc_end = (stopbrake + 0.1)*(-1.0);
+                        if((distoend < 0.3)||(PathPoint>=gpsMapLine.size()-2))acc_end = (stopbrake + 0.1)*(-1.0);
 
 
                         if(acc_end<0)minDecelerate = acc_end;

+ 1 - 1
src/decition/decition_brain_sf_changan_shenlan/decition_brain_sf_changan_shenlan.pro

@@ -2,7 +2,7 @@ QT -= gui
 
 QT += network dbus xml widgets
 
-CONFIG += c++11 console
+CONFIG += c++11  #console
 CONFIG -= app_bundle
 
 # The following define makes your compiler emit warnings if you use