Browse Source

change detection_chassis for shenlan_v2. change controller_changan_shenlan_v2, limit wheelangle, fail, so comment.

yuchuli 1 year ago
parent
commit
383fcf6e14

+ 14 - 11
src/controller/controller_changan_shenlan_v2/main.cpp

@@ -144,17 +144,20 @@ void executeDecition(const iv::brain::decition &decition)
 
     double fWheelAngleReq = decition.wheelangle();
     double fsendinter = 0.02;
-    if(fabs(fWheelAngleReq - gfWheelAngle)/fsendinter > gfWheelSpeedLim)
-    {
-        if(fWheelAngleReq > gfWheelAngle)
-        {
-            fWheelAngleReq = fWheelAngleReq + fsendinter * gfWheelSpeedLim;
-        }
-        else
-        {
-            fWheelAngleReq = fWheelAngleReq - fsendinter * gfWheelSpeedLim;
-        }
-    }
+//    if(fabs(fWheelAngleReq - gfWheelAngle)/fsendinter > gfWheelSpeedLim)
+//    {
+//        if(fWheelAngleReq > gfWheelAngle)
+//        {
+//            fWheelAngleReq = gfWheelAngle + fsendinter * gfWheelSpeedLim;
+//        }
+//        else
+//        {
+//            fWheelAngleReq = gfWheelAngle - fsendinter * gfWheelSpeedLim;
+//        }
+
+//    }
+
+    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,新车没有此信号

+ 2 - 1
src/detection/detection_chassis/decodechassis.cpp

@@ -489,6 +489,7 @@ int ProcShenLanCANFDChassis(void *pa, iv::can::canmsg *pmsg)
 
                 xchassis.set_vel(static_cast<float>(vehspeed));
                 ShareChassis(pa,&xchassis);
+                xchassis.clear_angle_feedback();
                 std::cout<<"veh: "<<xchassis.vel()<<std::endl;
             }
             else
@@ -512,7 +513,7 @@ int ProcShenLanCANFDChassis(void *pa, iv::can::canmsg *pmsg)
                     ang=static_cast<double>(value) * 0.1-65536*0.1;
 
                 xchassis.set_angle_feedback(static_cast<float>(ang));
-                ShareChassis(pa,&xchassis);
+     //           ShareChassis(pa,&xchassis);
                 std::cout<<"ang: "<<xchassis.angle_feedback()<<std::endl;
             }
             else