|
@@ -1760,6 +1760,40 @@ std::vector<int> GetLWIndex(std::vector<iv::lanewidthabcd> xvectorLWA,int nlane)
|
|
|
return xvectorindex;
|
|
|
}
|
|
|
|
|
|
+void CalcBorringRoad(pathsection xps,std::vector<PlanPoint> & xvectorPP)
|
|
|
+{
|
|
|
+ if(xps.mpRoad->GetRoadBorrowCount() == 0)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Road * pRoad = xps.mpRoad;
|
|
|
+ unsigned int nborrowsize = pRoad->GetRoadBorrowCount();
|
|
|
+ unsigned int i;
|
|
|
+ unsigned int nPPCount = xvectorPP.size();
|
|
|
+ for(i=0;i<nborrowsize;i++)
|
|
|
+ {
|
|
|
+ RoadBorrow * pborrow = pRoad->GetRoadBorrow(i);
|
|
|
+ if(pborrow == NULL)
|
|
|
+ {
|
|
|
+ std::cout<<"warning:can't get borrow"<<std::endl;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if((pborrow->GetMode() == "All")||((pborrow->GetMode()=="R2L")&&(xps.mainsel<0))||((pborrow->GetMode()=="L2R")&&(xps.mainsel>0)))
|
|
|
+ {
|
|
|
+ unsigned int j;
|
|
|
+ double soffset = pborrow->GetS();
|
|
|
+ double borrowlen = pborrow->GetLength();
|
|
|
+ for(j=0;j<xvectorPP.size();j++)
|
|
|
+ {
|
|
|
+ if((xvectorPP[j].mS>=soffset)&&(xvectorPP[j].mS<=(soffset + borrowlen)))
|
|
|
+ {
|
|
|
+ xvectorPP[j].mbBoringRoad = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
void CalcInLaneAvoid(pathsection xps,std::vector<PlanPoint> & xvectorPP,const double fvehiclewidth,
|
|
|
const int nchang1,const int nchang2,const int nchangpoint)
|
|
@@ -2271,6 +2305,11 @@ std::vector<PlanPoint> GetLanePoint(pathsection xps,std::vector<PlanPoint> xvPP,
|
|
|
|
|
|
CalcInLaneAvoid(xps,xvectorPP,fvehiclewidth,nchange1,nchange2,nchangepoint);
|
|
|
|
|
|
+ if(xps.mpRoad->GetRoadBorrowCount()>0)
|
|
|
+ {
|
|
|
+ CalcBorringRoad(xps,xvectorPP);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if(xps.mnStartLaneSel > 0)
|
|
|
{
|