Jelajahi Sumber

change globalplan.

yuchuli 2 tahun lalu
induk
melakukan
7ba1d89ff8
1 mengubah file dengan 9 tambahan dan 0 penghapusan
  1. 9 0
      src/driver/driver_map_xodrload/globalplan.cpp

+ 9 - 0
src/driver/driver_map_xodrload/globalplan.cpp

@@ -1348,6 +1348,7 @@ std::vector<PlanPoint> GetPoint(pathsection xpath,const double fspace = 0.1)
     std::vector<PlanPoint> xvectorPPS;
     double s = 0;
 
+
     int i;
     for(i=0;i<pRoad->GetGeometryBlockCount();i++)
     {
@@ -1403,6 +1404,14 @@ std::vector<PlanPoint> GetPoint(pathsection xpath,const double fspace = 0.1)
         {
             PlanPoint pp = xvectorPP.at(j);
 
+            double foffset = pRoad->GetLaneOffsetValue(pp.mS);
+
+            if(fabs(foffset)>0.001)
+            {
+                pp.x = pp.x + foffset * cos(pp.hdg + M_PI/2.0);
+                pp.y = pp.y + foffset * sin(pp.hdg + M_PI/2.0);
+            }
+
             pp.mfCurvature = pRoad->GetRoadCurvature(pp.mS);