|
@@ -978,11 +978,13 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
roadSum = gpsMapLine[PathPoint]->roadSum*3;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if(roadNowStart){
|
|
|
roadNow=roadOri;
|
|
|
roadNowStart=false;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if(ServiceCarStatus.avoidObs){
|
|
|
gpsMapLine[PathPoint]->runMode=1;
|
|
|
}else{
|
|
@@ -1517,7 +1519,7 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
}
|
|
|
|
|
|
//shiyanbizhang 0929
|
|
|
- if(obsDistance>0&& (obsDistance<ServiceCarStatus.socfDis+20.0) &&(abs(realspeed)<1.0) &&
|
|
|
+ if(obsDistance>0&& (obsDistance<ServiceCarStatus.aocfDis) &&(abs(realspeed)<5.0) &&
|
|
|
(vehState==normalRun||vehState==backOri || vehState==avoiding) &&(ObsTimeStart==-1)
|
|
|
&& (gpsMapLine[PathPoint]->runMode==1)){
|
|
|
ObsTimeStart=GetTickCount();
|
|
@@ -1537,7 +1539,7 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
cout<<"\n====================preAvoid time count finish==================\n"<<endl;
|
|
|
}
|
|
|
|
|
|
- if(obsDistance<0 ||obsDistance>ServiceCarStatus.socfDis){
|
|
|
+ if(obsDistance<0 ||obsDistance>ServiceCarStatus.aocfDis){
|
|
|
ObsTimeStart=-1;
|
|
|
ObsTimeEnd=-1;
|
|
|
ObsTimeSpan=-1;
|
|
@@ -1581,6 +1583,11 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+ givlog->debug("brain_decition","mfRoadwidth: %f",
|
|
|
+ gpsMapLine[PathPoint]->mfLaneWidth );
|
|
|
+
|
|
|
+
|
|
|
if (vehState == preAvoid)
|
|
|
{
|
|
|
cout<<"\n====================preAvoid==================\n"<<endl;
|
|
@@ -1899,7 +1906,12 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
// if(obsDistance>6.5){
|
|
|
// obsDistance=500;
|
|
|
//}
|
|
|
- if(obsDistance>0 && obsDistance<10){
|
|
|
+
|
|
|
+ if(ServiceCarStatus.msysparam.mvehtype=="hapo"){
|
|
|
+ if(obsDistance>0 && obsDistance<8){
|
|
|
+ dSpeed=0;
|
|
|
+ }
|
|
|
+ }else if(obsDistance>0 && obsDistance<15){
|
|
|
dSpeed=0;
|
|
|
}
|
|
|
// obsDistance=-1; //1227
|
|
@@ -2555,10 +2567,12 @@ void iv::decition::DecideGps00::computeObsOnRoad(iv::LidarGridPtr lidarGridPtr,
|
|
|
obsSpeed=obsSd;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ if(obsDistance<500&&obsDistance>0){
|
|
|
+ std::cout <<ServiceCarStatus.mRunTime.elapsed()<<"ms:"<< "obsDistance<500:" << obsDistance << std::endl;
|
|
|
+ }
|
|
|
std::cout <<ServiceCarStatus.mRunTime.elapsed()<<"ms:"<< "最终得出的obsDistance:" << obsDistance << std::endl;
|
|
|
|
|
|
+
|
|
|
ServiceCarStatus.mObs = obsDistance;
|
|
|
if(ServiceCarStatus.mObs>100){
|
|
|
ServiceCarStatus.mObs =-1;
|
|
@@ -2903,7 +2917,7 @@ int iv::decition::DecideGps00::chooseBackRoad(iv::LidarGridPtr lidarGridPtr, GPS
|
|
|
|
|
|
//if ((GetDistance(now_gps_ins, startAvoid_gps_ins)>avoidRunDistance)&&
|
|
|
//(checkReturnEnable(avoidX, lidarGridPtr,roadOri)))
|
|
|
- if ((GetDistance(now_gps_ins, startAvoidGpsInsVector[roadOri])>max(avoidMinDistanceVector[roadOri],30.0)) &&
|
|
|
+ if ((GetDistance(now_gps_ins, startAvoidGpsInsVector[roadOri])>max(avoidMinDistanceVector[roadOri],20.0)) &&
|
|
|
(checkReturnEnable(avoidX, lidarGridPtr, roadOri)))
|
|
|
{
|
|
|
roadPre = roadOri;
|
|
@@ -3344,7 +3358,7 @@ void iv::decition::DecideGps00::getEsrObsDistanceByFrenet(const std::vector<Poin
|
|
|
void iv::decition::DecideGps00::getV2XTrafficPositionVector(const std::vector<GPSData> gpsMapLine){
|
|
|
v2xTrafficVector.clear();
|
|
|
for (int var = 0; var < gpsMapLine.size(); var++) {
|
|
|
- if(gpsMapLine[var]->roadMode==6){
|
|
|
+ if(gpsMapLine[var]->roadMode==6|| gpsMapLine[var]->mode2==1000001){
|
|
|
v2xTrafficVector.push_back(var);
|
|
|
}
|
|
|
}
|
|
@@ -3473,28 +3487,28 @@ float iv::decition::DecideGps00::computeAvoidX(int roadAim,int roadOri,GPSData g
|
|
|
return 0;
|
|
|
}
|
|
|
float x=0;
|
|
|
- float veh_to_roadSide=(gps->mfRoadWidth- ServiceCarStatus.msysparam.vehWidth)*0.5;
|
|
|
+ float veh_to_roadSide=(gps->mfLaneWidth- ServiceCarStatus.msysparam.vehWidth)*0.5;
|
|
|
float roadSide_to_roadSide=ServiceCarStatus.msysparam.vehWidth;
|
|
|
if(!ServiceCarStatus.inRoadAvoid){
|
|
|
- x= (roadOri-roadAim)*gps->mfRoadWidth;
|
|
|
+ x= (roadOri-roadAim)*gps->mfLaneWidth;
|
|
|
}else{
|
|
|
int num=roadOri-roadAim;
|
|
|
switch (abs(num)%3) {
|
|
|
case 0:
|
|
|
- x=(num/3)*gps->mfRoadWidth;
|
|
|
+ x=(num/3)*gps->mfLaneWidth;
|
|
|
break;
|
|
|
case 1:
|
|
|
if(num>0){
|
|
|
- x=(num/3)*gps->mfRoadWidth +veh_to_roadSide;
|
|
|
+ x=(num/3)*gps->mfLaneWidth +veh_to_roadSide;
|
|
|
}else{
|
|
|
- x=(num/3)*gps->mfRoadWidth -veh_to_roadSide;
|
|
|
+ x=(num/3)*gps->mfLaneWidth -veh_to_roadSide;
|
|
|
}
|
|
|
break;
|
|
|
case 2:
|
|
|
if(num>0){
|
|
|
- x=(num/3)*gps->mfRoadWidth +veh_to_roadSide+roadSide_to_roadSide;
|
|
|
+ x=(num/3)*gps->mfLaneWidth +veh_to_roadSide+roadSide_to_roadSide;
|
|
|
}else{
|
|
|
- x=(num/3)*gps->mfRoadWidth -veh_to_roadSide-roadSide_to_roadSide;
|
|
|
+ x=(num/3)*gps->mfLaneWidth -veh_to_roadSide-roadSide_to_roadSide;
|
|
|
}
|
|
|
|
|
|
break;
|