|
@@ -1726,44 +1726,71 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
{
|
|
{
|
|
std::vector<Station> station_received;
|
|
std::vector<Station> station_received;
|
|
Station station_aa,station_nearest;
|
|
Station station_aa,station_nearest;
|
|
- station_received.clear();
|
|
|
|
- for(int i=0;i<ServiceCarStatus.stationCmd.stationTotalNum;i++)
|
|
|
|
|
|
+
|
|
|
|
+ if(ServiceCarStatus.stationCmd.has_emergencyStop)
|
|
{
|
|
{
|
|
- station_aa.index=i;
|
|
|
|
- station_aa.station_location.gps_lat=ServiceCarStatus.stationCmd.stationGps[i].gps_lat;
|
|
|
|
- station_aa.station_location.gps_lng=ServiceCarStatus.stationCmd.stationGps[i].gps_lng;
|
|
|
|
- station_received.push_back(station_aa);
|
|
|
|
|
|
+ if(ServiceCarStatus.stationCmd.emergencyStop==0x01)
|
|
|
|
+ {
|
|
|
|
+ ServiceCarStatus.carState = 0;
|
|
|
|
+ busMode=true;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ ServiceCarStatus.carState = 1;
|
|
|
|
+ busMode=false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- station_nearest=getNearestStation(now_gps_ins,station_received,gpsMapLine);
|
|
|
|
|
|
|
|
- if(ServiceCarStatus.stationCmd.emergencyStop==0x01)
|
|
|
|
|
|
+ if(ServiceCarStatus.stationCmd.has_stationStop)
|
|
{
|
|
{
|
|
- ServiceCarStatus.carState = 0;
|
|
|
|
- }
|
|
|
|
|
|
+ //寻找最近站点
|
|
|
|
+ station_received.clear();
|
|
|
|
+ for(int i=0;i<ServiceCarStatus.stationCmd.stationTotalNum;i++)
|
|
|
|
+ {
|
|
|
|
+ station_aa.index=i;
|
|
|
|
+ station_aa.station_location.gps_lat=ServiceCarStatus.stationCmd.stationGps[i].gps_lat;
|
|
|
|
+ station_aa.station_location.gps_lng=ServiceCarStatus.stationCmd.stationGps[i].gps_lng;
|
|
|
|
+ station_received.push_back(station_aa);
|
|
|
|
+ }
|
|
|
|
+ station_nearest=getNearestStation(now_gps_ins,station_received,gpsMapLine);
|
|
|
|
|
|
- if((ServiceCarStatus.stationCmd.stationStop==0x00))
|
|
|
|
|
|
+ //进入站点模式
|
|
|
|
+ if((ServiceCarStatus.stationCmd.stationStop==0x00))
|
|
|
|
+ {
|
|
|
|
+ ServiceCarStatus.carState = 2;
|
|
|
|
+ ServiceCarStatus.amilat=station_nearest.station_location.gps_lat;
|
|
|
|
+ ServiceCarStatus.amilng=station_nearest.station_location.gps_lng;
|
|
|
|
+ busMode=true;
|
|
|
|
+ }else
|
|
|
|
+ {
|
|
|
|
+ ServiceCarStatus.carState = 1;
|
|
|
|
+ busMode=false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(ServiceCarStatus.stationCmd.has_carMode)
|
|
{
|
|
{
|
|
- ServiceCarStatus.carState = 2;
|
|
|
|
- ServiceCarStatus.amilat=station_nearest.station_location.gps_lat;
|
|
|
|
- ServiceCarStatus.amilng=station_nearest.station_location.gps_lng;
|
|
|
|
|
|
+ if(ServiceCarStatus.stationCmd.carMode==0x00)
|
|
|
|
+ {
|
|
|
|
+ ServiceCarStatus.stationCmd.mode_manual_drive=true;
|
|
|
|
+ }else
|
|
|
|
+ {
|
|
|
|
+ ServiceCarStatus.stationCmd.mode_manual_drive=false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
ServiceCarStatus.stationCmd.received=false;
|
|
ServiceCarStatus.stationCmd.received=false;
|
|
- busMode=true;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+ //carState == 0,紧急停车
|
|
if (ServiceCarStatus.carState == 0 && busMode)
|
|
if (ServiceCarStatus.carState == 0 && busMode)
|
|
{
|
|
{
|
|
|
|
|
|
minDecelerate=-1.0;
|
|
minDecelerate=-1.0;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
if (ServiceCarStatus.carState == 3 && busMode)
|
|
if (ServiceCarStatus.carState == 3 && busMode)
|
|
{
|
|
{
|
|
|
|
|
|
@@ -1777,14 +1804,8 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- ///kkcai, 2020-01-03
|
|
|
|
- //if (ServiceCarStatus.carState == 2 && busMode)
|
|
|
|
- if (ServiceCarStatus.carState == 2)
|
|
|
|
|
|
+ //carState==2,站点停车
|
|
|
|
+ if ((ServiceCarStatus.carState==2)&&busMode)
|
|
{
|
|
{
|
|
|
|
|
|
aim_gps_ins.gps_lat=ServiceCarStatus.amilat;
|
|
aim_gps_ins.gps_lat=ServiceCarStatus.amilat;
|
|
@@ -1838,7 +1859,6 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
if (gpsMapLine[PathPoint]->runMode == 2)
|
|
if (gpsMapLine[PathPoint]->runMode == 2)
|
|
{
|
|
{
|
|
obsDistance = -1;
|
|
obsDistance = -1;
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
std::cout<<"juecesudu0="<<dSpeed<<std::endl;
|
|
std::cout<<"juecesudu0="<<dSpeed<<std::endl;
|
|
@@ -1888,7 +1908,10 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
phaseSpeedDecition(gps_decition, secSpeed, obsDistance, obsSpeed,now_gps_ins);
|
|
phaseSpeedDecition(gps_decition, secSpeed, obsDistance, obsSpeed,now_gps_ins);
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+ if(ServiceCarStatus.stationCmd.mode_manual_drive==true)
|
|
|
|
+ {
|
|
|
|
+ gps_decition->driveMode=0;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
gps_decition->wheel_angle = 0.0 - controlAng;
|
|
gps_decition->wheel_angle = 0.0 - controlAng;
|