Эх сурвалжийг харах

modify the min error in V2X logic

chenxiaowei 4 жил өмнө
parent
commit
b992eb1a50

+ 3 - 3
src/decition/decition_brain_sf_1x/decition/decide_gps_00.cpp

@@ -1996,7 +1996,7 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
     {
     {
        if((distance_to_center>=radiation_distance)&&(distance_to_center<=radiation_distance+10))
        if((distance_to_center>=radiation_distance)&&(distance_to_center<=radiation_distance+10))
        {
        {
-           dSpeed = min(1,realspeed-0.5);
+          dSpeed = min(1.0,realspeed-0.5);
        }
        }
        else if(distance_to_center<radiation_distance)
        else if(distance_to_center<radiation_distance)
        {
        {
@@ -2010,13 +2010,13 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
     {
     {
        if(distance_to_center<radiation_distance)
        if(distance_to_center<radiation_distance)
        {
        {
-           dSpeed=min(limit_spd,realspeed-0.5);
+          dSpeed=min((double)limit_spd,realspeed-0.5);
        }
        }
     }
     }
 //碰撞预警,1减速,2 停车
 //碰撞预警,1减速,2 停车
     if(warning_type==0x01)
     if(warning_type==0x01)
     {
     {
-        dSpeed=limit_spd;
+        dSpeed=limit_spd;//此处要判断限速值是不是在有效值范围以内
     }
     }
     else if(warning_type==0x01)
     else if(warning_type==0x01)
     {
     {