|
@@ -2050,25 +2050,24 @@ if((traffic_type==0x01)||(traffic_type==0x02)||(traffic_type==0x03)||(traffic_ty
|
|
ServiceCarStatus.vehicle_state_1x = 2;
|
|
ServiceCarStatus.vehicle_state_1x = 2;
|
|
ServiceCarStatus.target_spd_1x = 0;
|
|
ServiceCarStatus.target_spd_1x = 0;
|
|
}
|
|
}
|
|
-<<<<<<< Updated upstream
|
|
|
|
else
|
|
else
|
|
{}
|
|
{}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
ServiceCarStatus.vehicle_state_1x = 0;
|
|
ServiceCarStatus.vehicle_state_1x = 0;
|
|
|
|
+ ServiceCarStatus.target_spd_1x = dSpeed;
|
|
}
|
|
}
|
|
//红绿灯信息处理,computeTrafficSpeedLimt由于车子最高5所以要对速度做调整
|
|
//红绿灯信息处理,computeTrafficSpeedLimt由于车子最高5所以要对速度做调整
|
|
|
|
|
|
-=======
|
|
|
|
//红绿灯信息处理,computeTrafficSpeedLimt由于车子最高5所以要对速度做调整
|
|
//红绿灯信息处理,computeTrafficSpeedLimt由于车子最高5所以要对速度做调整
|
|
->>>>>>> Stashed changes
|
|
|
|
//-----------------------------------------1+X采集车车路协同,end---------------------------------------------
|
|
//-----------------------------------------1+X采集车车路协同,end---------------------------------------------
|
|
//-------------------------------traffic light----------------------------------------------------------------------------------------
|
|
//-------------------------------traffic light----------------------------------------------------------------------------------------
|
|
|
|
|
|
if(traffic_light_gps.gps_lat!=0 && traffic_light_gps.gps_lng!=0){
|
|
if(traffic_light_gps.gps_lat!=0 && traffic_light_gps.gps_lng!=0){
|
|
traffic_light_pathpoint = Compute00().getNoAngleNearestPointIndex(traffic_light_gps, gpsMapLine);
|
|
traffic_light_pathpoint = Compute00().getNoAngleNearestPointIndex(traffic_light_gps, gpsMapLine);
|
|
// traffic_light_pathpoint=130;
|
|
// traffic_light_pathpoint=130;
|
|
|
|
+ //1:绿灯 2:红灯 3:黄灯
|
|
float traffic_speed=ComputeTrafficLightSpeed(ServiceCarStatus.iTrafficeLightColor,ServiceCarStatus.iTrafficeLightTime,gpsMapLine,
|
|
float traffic_speed=ComputeTrafficLightSpeed(ServiceCarStatus.iTrafficeLightColor,ServiceCarStatus.iTrafficeLightTime,gpsMapLine,
|
|
traffic_light_pathpoint ,PathPoint,secSpeed,dSpeed);
|
|
traffic_light_pathpoint ,PathPoint,secSpeed,dSpeed);
|
|
dSpeed = min((double)traffic_speed,dSpeed);
|
|
dSpeed = min((double)traffic_speed,dSpeed);
|
|
@@ -2216,11 +2215,7 @@ else
|
|
<<"OBS_Speed"<< ","<<obsSpeed<< ","
|
|
<<"OBS_Speed"<< ","<<obsSpeed<< ","
|
|
<<"Traffic_Type"<< ","<<traffic_type<< ","
|
|
<<"Traffic_Type"<< ","<<traffic_type<< ","
|
|
<<"Warn_Type"<< ","<<warning_type<< ","
|
|
<<"Warn_Type"<< ","<<warning_type<< ","
|
|
-<<<<<<< Updated upstream
|
|
|
|
<<"Limit_Speed"<< ","<<trafficlimit_spd<< ","
|
|
<<"Limit_Speed"<< ","<<trafficlimit_spd<< ","
|
|
-=======
|
|
|
|
- <<"Limit_Speed"<< ","<<limit_spd<< ","
|
|
|
|
->>>>>>> Stashed changes
|
|
|
|
<<endl;
|
|
<<endl;
|
|
outfile.close();
|
|
outfile.close();
|
|
}
|
|
}
|
|
@@ -3771,24 +3766,25 @@ float iv::decition::DecideGps00::ComputeTrafficLightSpeed(int traffic_light_col
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+//1+x V2R //1:绿灯 2:红灯 3:黄灯
|
|
|
|
+ //最开始0x0: 红色 0x1: 黄色 0x2: 绿色
|
|
|
|
|
|
switch(traffic_light_color){
|
|
switch(traffic_light_color){
|
|
- case 0:
|
|
|
|
|
|
+ case 2://case 0: //for 1+x修改
|
|
if(passTime>traffic_light_time+1 && traffic_dis>10){
|
|
if(passTime>traffic_light_time+1 && traffic_dis>10){
|
|
passEnable=true;
|
|
passEnable=true;
|
|
}else{
|
|
}else{
|
|
passEnable=false;
|
|
passEnable=false;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case 1:
|
|
|
|
|
|
+ case 3:// case 1:
|
|
if(passTime<traffic_light_time-1 && traffic_dis<10){
|
|
if(passTime<traffic_light_time-1 && traffic_dis<10){
|
|
passEnable=true;
|
|
passEnable=true;
|
|
}else{
|
|
}else{
|
|
passEnable = false;
|
|
passEnable = false;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case 2:
|
|
|
|
|
|
+ case 1://case 2:
|
|
if(passTime<traffic_light_time){
|
|
if(passTime<traffic_light_time){
|
|
passEnable= true;
|
|
passEnable= true;
|
|
}else{
|
|
}else{
|