Browse Source

change driver_map_xodrload. fix roadsum.

yuchuli 3 years ago
parent
commit
77a716b79a

+ 19 - 1
src/decition/decition_brain/decision/obs_mobieye.cpp

@@ -83,6 +83,22 @@ int obs_mobieye::GetCandidataObs(std::vector<iv::Point2D> &xgpstrace, iv::mobile
 
 }
 
+
+
+int obs_mobieye::GetObs(std::vector<iv::Point2D> &xgpstrace, iv::mobileye::mobileye &xmobieye,
+                        const double fveh_width, std::vector<iv::mobieyeobstotrace> &xvectoroptobs,
+                        double &xobsdis, double &xobsspeed, double &xttc, double &xobsid)
+{
+    std::vector<QPointF> xPointTrace;
+    std::vector<QPointF> xPointObs;
+    unsigned int i;
+    for(i=0;i<xvectoroptobs.size();i++)
+    {
+        iv::Point2D xPoint = xgpstrace[xvectoroptobs[i].traceindex];
+        iv::mobileye::obs * pobs = xmobieye.xobj(xvectoroptobs[i].obsindex);
+    }
+}
+
 int obs_mobieye::GetObsFromMobieye(std::vector<iv::Point2D> *pgpsTrace,
                                    double &xobsdis, double &xobsspeed, double &xttc, double &xobsid,const double fveh_width)
 {
@@ -114,9 +130,11 @@ int obs_mobieye::GetObsFromMobieye(std::vector<iv::Point2D> *pgpsTrace,
 
     if(xvectoroptobs.size() < 1)
     {
-
+        return 0;
     }
 
+
+
     return 0;
 
 }

+ 8 - 0
src/decition/decition_brain/decision/obs_mobieye.h

@@ -2,6 +2,7 @@
 #define OBS_MOBIEYE_H
 
 #include <QMutex>
+#include <QPointF>
 
 #include "mobileye.pb.h"
 
@@ -45,6 +46,13 @@ private:
     int GetCandidataObs(std::vector<iv::Point2D> & xgpstrace,iv::mobileye::mobileye & xmobieye,
                         const double fveh_width,std::vector<iv::mobieyeobstotrace>  & xvectoroptobs);
 
+    int GetObs(std::vector<iv::Point2D> & xgpstrace,iv::mobileye::mobileye & xmobieye,
+               const double fveh_width,std::vector<iv::mobieyeobstotrace>  & xvectoroptobs,
+               double & xobsdis, double & xobsspeed, double & xttc,
+                                         double & xobsid);
+
+    void GetRectPoint(std::vector<iv::Point2D> & xgpstrace,int index,std::vector<QPointF> & xPoint,const double fveh_width);
+    void GetRectPoint(iv::mobileye::obs * pobs,std::vector<QPointF> & xPoint);
 };
 
 #endif // OBS_MOBIEYE_H

+ 6 - 6
src/driver/driver_map_xodrload/globalplan.cpp

@@ -2032,12 +2032,12 @@ std::vector<PlanPoint> GetLanePoint(pathsection xps,std::vector<PlanPoint> xvPP,
                 pp.mfSecy = pp.y ;
             }
 
-            pp.mWidth = getwidth(xps.mpRoad,nlane1,xvectorLWA,pp.mS);
+            pp.mWidth = getwidth(xps.mpRoad,xps.mainsel,xvectorLWA,pp.mS);
             pp.mfDisToLaneLeft = pp.mWidth/2.0;
             pp.lanmp = 0;
             pp.mfDisToRoadLeft = off1*(-1);
-            pp.mfRoadWidth = GetRoadWidth(xvectorLWA,nlane1,pp.mS);
-            GetLaneOriTotal(xps.mpRoad,nlane1,pp.mS,pp.mnLaneori,pp.mnLaneTotal,pp.speed);
+            pp.mfRoadWidth = GetRoadWidth(xvectorLWA,xps.mainsel,pp.mS);
+            GetLaneOriTotal(xps.mpRoad,xps.mainsel,pp.mS,pp.mnLaneori,pp.mnLaneTotal,pp.speed);
 
             xvectorPP.push_back(pp);
         }
@@ -2079,12 +2079,12 @@ std::vector<PlanPoint> GetLanePoint(pathsection xps,std::vector<PlanPoint> xvPP,
                 pp.mfSecy = pp.y ;
             }
 
-            pp.mWidth = getwidth(xps.mpRoad,nlane1,xvectorLWA,pp.mS);
+            pp.mWidth = getwidth(xps.mpRoad,xps.mainsel,xvectorLWA,pp.mS);
             pp.mfDisToLaneLeft = pp.mWidth/2.0;
             pp.lanmp = 0;
             pp.mfDisToRoadLeft = off1;
-            pp.mfRoadWidth = GetRoadWidth(xvectorLWA,nlane1,pp.mS);
-            GetLaneOriTotal(xps.mpRoad,nlane1,pp.mS,pp.mnLaneori,pp.mnLaneTotal,pp.speed);
+            pp.mfRoadWidth = GetRoadWidth(xvectorLWA,xps.mainsel,pp.mS);
+            GetLaneOriTotal(xps.mpRoad,xps.mainsel,pp.mS,pp.mnLaneori,pp.mnLaneTotal,pp.speed);
 
             xvectorPP.push_back(pp);
         }

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

@@ -514,6 +514,7 @@ void SetPlan(xodrobj xo)
         data->mfLaneWidth = xPlan[i].mWidth;
         data->mfRoadWidth = xPlan[i].mfRoadWidth;
 
+
         data->mbInLaneAvoid = xPlan[i].bInlaneAvoid;
 
         data->mode2 = xPlan[i].nSignal;
@@ -574,7 +575,7 @@ void SetPlan(xodrobj xo)
 
         char strline[255];
         snprintf(strline,255,"%d\t%11.7f\t%11.7f\t%d\t%d\t%11.3f\t%d\t%d\t%d\t%d\n",
-                 i,data->gps_lng,data->gps_lat,0,data->ins_heading_angle,0,0,0,0,0);
+                 i,data->gps_lng,data->gps_lat,0,data->ins_heading_angle,0,0,0,data->roadOri,data->roadSum);
         xfile.write(strline);
 
     }