|
@@ -2768,6 +2768,8 @@ void ChangeLane(std::vector<PlanPoint> & xvectorPP)
|
|
{
|
|
{
|
|
int i = 0;
|
|
int i = 0;
|
|
int nsize = xvectorPP.size();
|
|
int nsize = xvectorPP.size();
|
|
|
|
+ int nstart = -1;
|
|
|
|
+ int nend = -1;
|
|
for(i=0;i<nsize;i++)
|
|
for(i=0;i<nsize;i++)
|
|
{
|
|
{
|
|
if((xvectorPP[i].mfSecx == xvectorPP[i].x)&&(xvectorPP[i].mfSecy == xvectorPP[i].y))
|
|
if((xvectorPP[i].mfSecx == xvectorPP[i].x)&&(xvectorPP[i].mfSecy == xvectorPP[i].y))
|
|
@@ -2788,7 +2790,7 @@ void ChangeLane(std::vector<PlanPoint> & xvectorPP)
|
|
int nchangepoint = 300;
|
|
int nchangepoint = 300;
|
|
double froadlen = sqrt(pow(xvectorPP[k].x - xvectorPP[i].x,2)
|
|
double froadlen = sqrt(pow(xvectorPP[k].x - xvectorPP[i].x,2)
|
|
+pow(xvectorPP[k].y - xvectorPP[i].y,2));
|
|
+pow(xvectorPP[k].y - xvectorPP[i].y,2));
|
|
- const double fMAXCHANGE = 100;
|
|
|
|
|
|
+ const double fMAXCHANGE = 50;
|
|
if(froadlen<fMAXCHANGE)
|
|
if(froadlen<fMAXCHANGE)
|
|
{
|
|
{
|
|
nchangepoint = nnum;
|
|
nchangepoint = nnum;
|
|
@@ -2801,8 +2803,8 @@ void ChangeLane(std::vector<PlanPoint> & xvectorPP)
|
|
qDebug(" road %d len is %f changepoint is %d nnum is %d",
|
|
qDebug(" road %d len is %f changepoint is %d nnum is %d",
|
|
xvectorPP[k-1].nRoadID,froadlen,nchangepoint,nnum);
|
|
xvectorPP[k-1].nRoadID,froadlen,nchangepoint,nnum);
|
|
|
|
|
|
- int nstart = i + nnum/2 -nchangepoint/2;
|
|
|
|
- int nend = i+nnum/2 + nchangepoint/2;
|
|
|
|
|
|
+ nstart = i + nnum/2 -nchangepoint/2;
|
|
|
|
+ nend = i+nnum/2 + nchangepoint/2;
|
|
if(nnum<300)
|
|
if(nnum<300)
|
|
{
|
|
{
|
|
nstart = i;
|
|
nstart = i;
|
|
@@ -2838,6 +2840,24 @@ void ChangeLane(std::vector<PlanPoint> & xvectorPP)
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(nstart != -1)
|
|
|
|
+ {
|
|
|
|
+ for(i=0;i<nstart;i++)
|
|
|
|
+ {
|
|
|
|
+ xvectorPP[i].nlrchange = 0;
|
|
|
|
+ if(i>nsize)break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(nend >0)
|
|
|
|
+ {
|
|
|
|
+ for(i=nend;i<nsize;i++)
|
|
|
|
+ {
|
|
|
|
+ xvectorPP[i].nlrchange = 0;
|
|
|
|
+ if(i>nsize)break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
#include <QFile>
|
|
#include <QFile>
|