소스 검색

change some cherry code, fix controller and chassis.

yuchuli 5 달 전
부모
커밋
9b84a37e57
2개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      src/controller/controller_chery_sterra_es_fcm/main.cpp
  2. 4 0
      src/detection/detection_chassis/decodechassis.cpp

+ 3 - 2
src/controller/controller_chery_sterra_es_fcm/main.cpp

@@ -90,7 +90,7 @@ static double ki = 0.0;
 static double kd =  0.0;
 static double MAXACC = 3.0;
 static int64_t gnLastAccUptime = 0;
-static bool gbUsePID = true;
+static bool gbUsePID = false;
 static bool gbPrintPIDOut = true;
 static double TorqueRatio = 1.4;
 
@@ -196,11 +196,12 @@ double fpidtestmaxvel = 15.0;
 
 void executeDecition(const iv::brain::decition &decition)
 {
-    double fwheel = decition.wheelangle()*0.9;
+    double fwheel = decition.wheelangle();
     if(fwheel<-430)fwheel = 430;
     if(fwheel>380)fwheel = 380;
 
     double ftorque = decition.torque() * TorqueRatio;
+    if((ftorque>30)&&(ftorque<150))ftorque = 150;
     double fbrake = decition.brake();
 
 #ifdef PIDTEST

+ 4 - 0
src/detection/detection_chassis/decodechassis.cpp

@@ -613,6 +613,10 @@ int ProcSterraesChassis(void *pa, iv::can::canmsg *pmsg){
                                     xvectortime.erase(xvectortime.begin());
                                     xvectorvel.erase(xvectorvel.begin());
                                 }
+                                else
+                                {
+                                    break;
+                                }
                             }
                         }
                     }