Browse Source

chang tool/map_lanetoxodr. add boring road avoid but comment.

yuchuli 3 years ago
parent
commit
0156254a7c
1 changed files with 22 additions and 0 deletions
  1. 22 0
      src/driver/driver_map_xodrload/main.cpp

+ 22 - 0
src/driver/driver_map_xodrload/main.cpp

@@ -510,6 +510,28 @@ void SetPlan(xodrobj xo)
             }
         }
 
+#ifdef BOAVOID
+        if(data->mfLaneWidth<4.0)
+        {
+            const int nrangeavoid = 600;
+            if((i+(nrangeavoid + 10))<nSize)
+            {
+                double fhdg1 = xPlan[i].hdg;
+                double fhdg2 = xPlan[i+nrangeavoid].hdg;
+                double fhdg3 = xPlan[i+nrangeavoid + 5].hdg;
+                double fhdgdiff1 = fhdg2 - fhdg1;
+                double fhdgdiff2 = fhdg3 - fhdg1;
+                while(fhdgdiff1<0)fhdgdiff1 = fhdgdiff1 + 2.0*M_PI;
+                while(fhdgdiff2<0)fhdgdiff2 = fhdgdiff2 + 2.0*M_PI;
+                if(((fhdgdiff1<(M_PI/3.0))||(fhdgdiff1>(5.0*M_PI/6.0)))&&((fhdgdiff2<(M_PI/3.0))||(fhdgdiff2>(5.0*M_PI/6.0))))
+                {
+                    data->roadSum = 2;
+                    data->roadOri = 0;
+                }
+            }
+        }
+#endif
+
 //        data->roadSum = 1;
 //        data->roadMode = 0;
 //        data->roadOri = 0;