Browse Source

change driver_map_xodrload.

yuchuli 2 years ago
parent
commit
4260b6dff0
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/driver/driver_map_xodrload/main.cpp

+ 10 - 2
src/driver/driver_map_xodrload/main.cpp

@@ -567,13 +567,14 @@ inline bool isboringroad(int nroadid)
 void CalcLaneSide(std::vector<PlanPoint> & xPlan)
 {
     const double fsidedis = 0.3;
-    const int nChangePoint = 150;
-    const int nStopPoint = 50;
+    const int nChangePoint = 350;
+    const int nStopPoint = 150;
     if(xPlan.size()<nChangePoint)return;
 
     int i;
     int nsize = xPlan.size();
 
+    bool bChangeLane = false;
 
     for(i=(nsize-1);i>=(nsize - nStopPoint);i--)
     {
@@ -584,6 +585,12 @@ void CalcLaneSide(std::vector<PlanPoint> & xPlan)
         xPlan[i].x = xold + fMove*cos(xPlan[i].hdg - M_PI/2.0);
         xPlan[i].y = yold + fMove*sin(xPlan[i].hdg - M_PI/2.0);
         xPlan[i].mfDisToLaneLeft = xPlan[i].mfDisToLaneLeft + fMove;
+        if(fMove>2.0)
+        {
+            bChangeLane = true;
+        }
+        if(bChangeLane)
+            xPlan[i].nlrchange = 2;
     }
 
     for(i=(nsize-nStopPoint-1);i>=(nsize - nChangePoint);i--)
@@ -596,6 +603,7 @@ void CalcLaneSide(std::vector<PlanPoint> & xPlan)
         xPlan[i].x = xold + fRatio*fMove*cos(xPlan[i].hdg - M_PI/2.0);
         xPlan[i].y = yold + fRatio*fMove*sin(xPlan[i].hdg - M_PI/2.0);
         xPlan[i].mfDisToLaneLeft = xPlan[i].mfDisToLaneLeft + fRatio*fMove;
+        if(bChangeLane)xPlan[i].nlrchange = 2;
     }
     return;
 }