Browse Source

change decition_brain. add hapo vehicletable code.

yuchuli 3 years ago
parent
commit
00fa1d819a

+ 10 - 0
src/decition/decition_brain/decition/adc_adapter/hapo_adapter.cpp

@@ -199,6 +199,16 @@ iv::decition::Decition iv::decition::HapoAdapter::getAdapterDeciton(GPS_INS now_
     lastTorque=(*decition)->torque;
 
 
+    if(IsINterpolationOK())
+    {
+        double ftorque,fbrake;
+        GetTorqueBrake(now_gps_ins.speed, accAim,ftorque,fbrake);
+        (*decition)->brake = fbrake;
+
+        (*decition)->torque= ftorque;
+    }
+
+
 
 
     (*decition)->grade=1;

+ 12 - 1
src/decition/decition_brain/decition/decide_gps_00.cpp

@@ -965,13 +965,24 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
 
     //2020-01-03, kkcai
     //if(!circleMode && PathPoint>gpsMapLine.size()-200){
-    if(!circleMode && PathPoint>gpsMapLine.size()-100){
+    if(!circleMode && PathPoint>gpsMapLine.size()-500){
         minDecelerate=-1.0;
         std::cout<<"map finish brake"<<std::endl;
+        double nowspeed = realspeed/3.6;
+        int nmapsize = gpsMapLine.size();
+        double distoend = sqrt(pow(now_gps_ins.gps_x - gpsMapLine[nmapsize-1]->gps_x,2)
+                               +pow(now_gps_ins.gps_y - gpsMapLine[nmapsize-1]->gps_y,2));
+        if((distoend<10)||(distoend<(nowspeed*nowspeed)))
+        {
+            minDecelerate = (-1.0)*nowspeed*nowspeed/(2.0*distoend);
+        }
+        if(distoend<0.5)minDecelerate = -3.0;
     }
 
 
 
+
+
     if(!ServiceCarStatus.inRoadAvoid){
         roadOri = gpsMapLine[PathPoint]->roadOri;
         roadSum = gpsMapLine[PathPoint]->roadSum;