|
@@ -933,32 +933,68 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
|
|
|
double acc_end = 0.1;
|
|
double acc_end = 0.1;
|
|
static double distoend=1000;
|
|
static double distoend=1000;
|
|
- if((ServiceCarStatus.table_look_up_on==true)&&(hapo_Adapter->IsINterpolationOK()))
|
|
|
|
|
|
+// if((ServiceCarStatus.table_look_up_on==true)&&(hapo_Adapter->IsINterpolationOK()))
|
|
|
|
+// {
|
|
|
|
+// if(PathPoint+1000>gpsMapLine.size())
|
|
|
|
+// {
|
|
|
|
+// distoend=computeDistToEnd(gpsMapLine,PathPoint);
|
|
|
|
+// }
|
|
|
|
+// else
|
|
|
|
+// {
|
|
|
|
+// distoend=1000;
|
|
|
|
+// }
|
|
|
|
+// if(!circleMode && distoend<50)
|
|
|
|
+// {
|
|
|
|
+// double nowspeed = realspeed/3.6;
|
|
|
|
+// if((distoend<10)||(distoend<(nowspeed*nowspeed)+2))
|
|
|
|
+// {
|
|
|
|
+// if(distoend == 0.0)
|
|
|
|
+// distoend = 0.09;
|
|
|
|
+// acc_end = (-1.0)*nowspeed*nowspeed/(2.0*distoend);
|
|
|
|
+// if(acc_end<(-3.0))
|
|
|
|
+// acc_end = -3.0;
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// if((distoend < 2.1)||(PathPoint>=gpsMapLine.size()-2))
|
|
|
|
+// acc_end = -0.5;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+ int useaccend = 1;
|
|
|
|
+ double mstopbrake=0.3;
|
|
|
|
+ if(((ServiceCarStatus.table_look_up_on==true)&&(hapo_Adapter->IsINterpolationOK()))||(useaccend == 1))
|
|
{
|
|
{
|
|
- if(PathPoint+1000>gpsMapLine.size())
|
|
|
|
- {
|
|
|
|
- distoend=computeDistToEnd(gpsMapLine,PathPoint);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- distoend=1000;
|
|
|
|
- }
|
|
|
|
- if(!circleMode && distoend<50)
|
|
|
|
- {
|
|
|
|
- double nowspeed = realspeed/3.6;
|
|
|
|
- if((distoend<10)||(distoend<(nowspeed*nowspeed)+2))
|
|
|
|
- {
|
|
|
|
- if(distoend == 0.0)
|
|
|
|
- distoend = 0.09;
|
|
|
|
- acc_end = (-1.0)*nowspeed*nowspeed/(2.0*distoend);
|
|
|
|
- if(acc_end<(-3.0))
|
|
|
|
- acc_end = -3.0;
|
|
|
|
- }
|
|
|
|
|
|
+ if(PathPoint+1000>gpsMapLine.size()){
|
|
|
|
+ distoend=computeDistToEnd(gpsMapLine,PathPoint);
|
|
|
|
+ }else{
|
|
|
|
+ distoend=1000;
|
|
|
|
+ }
|
|
|
|
+ if(!circleMode && distoend<100){
|
|
|
|
+ double nowspeed = realspeed/3.6;
|
|
|
|
+ double brakedis = 100;
|
|
|
|
+ double stopbrake = mstopbrake;
|
|
|
|
+ if(nowspeed>10)
|
|
|
|
+ {
|
|
|
|
+ brakedis = (nowspeed*nowspeed)/(2*2.0);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ brakedis = (nowspeed*nowspeed)/(2*stopbrake)+3;
|
|
|
|
+ }
|
|
|
|
+ if((distoend<3)||(distoend<brakedis))
|
|
|
|
+ {
|
|
|
|
+ if(distoend == 0.0)distoend = 0.09;
|
|
|
|
+ acc_end = (-1.0)*nowspeed*nowspeed/(2.0*distoend);
|
|
|
|
+ if((acc_end<(-3.0))&&(nowspeed<10))acc_end = -3.0;
|
|
|
|
+ }
|
|
|
|
|
|
- if((distoend < 2.1)||(PathPoint>=gpsMapLine.size()-2))
|
|
|
|
- acc_end = -0.5;
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
|
|
+ if((distoend < 0.5)||(PathPoint>=gpsMapLine.size()-2))acc_end = (stopbrake + 0.1)*(-1.0);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if(acc_end<0)minDecelerate = acc_end;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
// if(!circleMode && PathPoint>gpsMapLine.size()-brake_distance){
|
|
// if(!circleMode && PathPoint>gpsMapLine.size()-brake_distance){
|
|
// minDecelerate=-0.5;
|
|
// minDecelerate=-0.5;
|
|
// std::cout<<"map finish brake"<<std::endl;
|
|
// std::cout<<"map finish brake"<<std::endl;
|
|
@@ -969,6 +1005,8 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
static int BrakePoint=-1;
|
|
static int BrakePoint=-1;
|
|
static bool final_brake=false;
|
|
static bool final_brake=false;
|
|
static double distance_to_end=1000;
|
|
static double distance_to_end=1000;
|
|
|
|
+ static bool enterTofinal=false; //20230417,shenlan
|
|
|
|
+ static double enterTofinal_speed=200;
|
|
if(PathPoint+forecast_final_point>gpsMapLine.size())
|
|
if(PathPoint+forecast_final_point>gpsMapLine.size())
|
|
{
|
|
{
|
|
distance_to_end=computeDistToEnd(gpsMapLine,PathPoint);
|
|
distance_to_end=computeDistToEnd(gpsMapLine,PathPoint);
|
|
@@ -993,6 +1031,8 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
final_brake_lock=false;
|
|
final_brake_lock=false;
|
|
brake_mode=false;
|
|
brake_mode=false;
|
|
BrakePoint=-1;
|
|
BrakePoint=-1;
|
|
|
|
+ enterTofinal=false; //20230417,shenlan
|
|
|
|
+ enterTofinal_speed=200;
|
|
}
|
|
}
|
|
if(final_brake==true)
|
|
if(final_brake==true)
|
|
{
|
|
{
|
|
@@ -1002,12 +1042,35 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- dSpeed=min(dSpeed, 3.0);
|
|
|
|
|
|
+ if(enterTofinal==false) //20230417,shenlan)
|
|
|
|
+ {
|
|
|
|
+ enterTofinal_speed=realspeed;
|
|
|
|
+ enterTofinal=true;
|
|
|
|
+ }
|
|
|
|
+ if(ServiceCarStatus.msysparam.mvehtype=="shenlan")
|
|
|
|
+ {
|
|
|
|
+ dSpeed=min(enterTofinal_speed, 3.0);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ dSpeed=min(dSpeed, 3.0);
|
|
|
|
+ }
|
|
final_brake_lock=true;
|
|
final_brake_lock=true;
|
|
brake_mode=true;
|
|
brake_mode=true;
|
|
- if(distance_to_end<0.8)
|
|
|
|
|
|
+ if(ServiceCarStatus.msysparam.mvehtype=="shenlan")
|
|
{
|
|
{
|
|
- minDecelerate=-0.7;
|
|
|
|
|
|
+ if(distance_to_end<2.0)
|
|
|
|
+ {
|
|
|
|
+ minDecelerate=-0.7;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if(distance_to_end<0.8)
|
|
|
|
+ {
|
|
|
|
+ minDecelerate=-0.7;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2487,6 +2550,7 @@ else
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(obsDistance == 0)obsDistance = -1;
|
|
phaseSpeedDecition(gps_decition, secSpeed, obsDistance, obsSpeed,now_gps_ins);
|
|
phaseSpeedDecition(gps_decition, secSpeed, obsDistance, obsSpeed,now_gps_ins);
|
|
|
|
|
|
Point2D now_s_d=iv::decition::cartesian_to_frenet1D(gpsMapLine,now_gps_ins.gps_x,now_gps_ins.gps_y);
|
|
Point2D now_s_d=iv::decition::cartesian_to_frenet1D(gpsMapLine,now_gps_ins.gps_x,now_gps_ins.gps_y);
|
|
@@ -3722,6 +3786,10 @@ void iv::decition::DecideGps00::computeObsOnRoadXY( iv::GPS_INS now_gps_ins,iv::
|
|
obsFrenet.s=obsFrenetMid.s-now_s_d.s;
|
|
obsFrenet.s=obsFrenetMid.s-now_s_d.s;
|
|
lidarDistance = obsFrenet.s;//obsPoint.y + lidarXiuZheng; //激光距离推到车头 gjw20191110 lidar
|
|
lidarDistance = obsFrenet.s;//obsPoint.y + lidarXiuZheng; //激光距离推到车头 gjw20191110 lidar
|
|
// lidarDistance=-1;
|
|
// lidarDistance=-1;
|
|
|
|
+// if(obsPoint.s < 0)
|
|
|
|
+// {
|
|
|
|
+// lidarDistance = -1;
|
|
|
|
+// }
|
|
if (lidarDistance<0)
|
|
if (lidarDistance<0)
|
|
{
|
|
{
|
|
lidarDistance = -1;
|
|
lidarDistance = -1;
|
|
@@ -4213,7 +4281,7 @@ float iv::decition::DecideGps00::ComputeTrafficLightSpeed(int traffic_light_col
|
|
return traffic_speed;
|
|
return traffic_speed;
|
|
}
|
|
}
|
|
|
|
|
|
-float iv::decition::DecideGps00::ComputeTrafficLightSpeed(int traffic_light_color, int traffic_light_time, const std::vector<GPSData> gpsMapLine,int traffic_light_pathpoint,
|
|
|
|
|
|
+float iv::decition::DecideGps00:: ComputeTrafficLightSpeed(int traffic_light_color, int traffic_light_time, const std::vector<GPSData> gpsMapLine,int traffic_light_pathpoint,
|
|
int pathpoint,float secSpeed,float dSpeed){
|
|
int pathpoint,float secSpeed,float dSpeed){
|
|
float traffic_speed=200;
|
|
float traffic_speed=200;
|
|
float traffic_dis=0;
|
|
float traffic_dis=0;
|
|
@@ -4303,6 +4371,7 @@ float iv::decition::DecideGps00::ComputeTrafficLightSpeed(int traffic_light_col
|
|
|
|
|
|
|
|
|
|
default:
|
|
default:
|
|
|
|
+ passEnable=true; //20230413
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|