|
@@ -60,12 +60,13 @@ int iv::decition::Compute00::getDesiredSpeed(std::vector<GPSData> gpsMap)
|
|
|
for (int j = startIndex; j < endIndex; j++)
|
|
|
{
|
|
|
int i = (j + gpsMap.size()) % gpsMap.size();
|
|
|
- (*gpsMap[i]).roadMode=5;
|
|
|
+ if((*gpsMap[i]).roadMode!=6)
|
|
|
+ (*gpsMap[i]).roadMode=5;
|
|
|
}
|
|
|
- for (int j = startIndex; j < (endIndex-10); j+=10)
|
|
|
+ for (int j = startIndex; j < (endIndex-40); j+=40)
|
|
|
{
|
|
|
int i = (j + gpsMap.size()) % gpsMap.size();
|
|
|
- for(int front_k=i;front_k<i+5;front_k++)
|
|
|
+ for(int front_k=i;front_k<i+20;front_k++)
|
|
|
{
|
|
|
if(fabs(((*gpsMap[front_k]).ins_heading_angle)-((*gpsMap[i]).ins_heading_angle))<10)
|
|
|
{
|
|
@@ -74,11 +75,11 @@ int iv::decition::Compute00::getDesiredSpeed(std::vector<GPSData> gpsMap)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- i+=5;
|
|
|
+ i+=20;
|
|
|
FrontAveFive=FrontTotalFive/FrontCount;
|
|
|
FrontTotalFive=0;
|
|
|
FrontCount=0;
|
|
|
- for(int back_k=i;back_k<i+5;back_k++)
|
|
|
+ for(int back_k=i;back_k<i+20;back_k++)
|
|
|
{
|
|
|
if(fabs((*gpsMap[back_k]).ins_heading_angle-(*gpsMap[i]).ins_heading_angle)<10)
|
|
|
{
|
|
@@ -87,14 +88,14 @@ int iv::decition::Compute00::getDesiredSpeed(std::vector<GPSData> gpsMap)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- i+=5;
|
|
|
+ i+=20;
|
|
|
CurrentIndex=i-1;
|
|
|
BackAveFive=BackTotalFive/BackCount;
|
|
|
BackTotalFive=0;
|
|
|
BackCount=0;
|
|
|
if(fabs(FrontAveFive-BackAveFive)<50)
|
|
|
{
|
|
|
- if(fabs(FrontAveFive-BackAveFive)>3)
|
|
|
+ if(fabs(FrontAveFive-BackAveFive)>4)
|
|
|
{
|
|
|
CurveContinue+=1;
|
|
|
if(CurveContinue>=2)
|
|
@@ -102,14 +103,15 @@ int iv::decition::Compute00::getDesiredSpeed(std::vector<GPSData> gpsMap)
|
|
|
MarkingCount=0;
|
|
|
for(MarkingIndex=CurrentIndex;MarkingIndex>=MarkedIndex;MarkingIndex--)
|
|
|
{
|
|
|
-
|
|
|
+ if((*gpsMap[MarkingIndex]).roadMode!=6)
|
|
|
+ {
|
|
|
if(MarkingCount<100)
|
|
|
{
|
|
|
- if((BackAveFive-FrontAveFive)<3)
|
|
|
+ if((BackAveFive-FrontAveFive)<4)
|
|
|
{
|
|
|
(*gpsMap[MarkingIndex]).roadMode=14; //弯道,2米,14
|
|
|
}
|
|
|
- else if((BackAveFive-FrontAveFive)>3)
|
|
|
+ else if((BackAveFive-FrontAveFive)>4)
|
|
|
{
|
|
|
(*gpsMap[MarkingIndex]).roadMode=15;
|
|
|
}
|
|
@@ -131,13 +133,14 @@ int iv::decition::Compute00::getDesiredSpeed(std::vector<GPSData> gpsMap)
|
|
|
{
|
|
|
(*gpsMap[MarkingIndex]).roadMode=11; //高速/疯狂加速,大于60米
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
MarkingCount++;
|
|
|
}
|
|
|
MarkedIndex=CurrentIndex;
|
|
|
}
|
|
|
}
|
|
|
- else if(fabs(FrontAveFive-BackAveFive)<=3)
|
|
|
+ else if(fabs(FrontAveFive-BackAveFive)<=4)
|
|
|
{
|
|
|
CurveContinue=0;
|
|
|
}
|
|
@@ -151,7 +154,8 @@ int iv::decition::Compute00::getDesiredSpeed(std::vector<GPSData> gpsMap)
|
|
|
MarkingCount=0;
|
|
|
for(MarkingIndex=endIndex;MarkingIndex>=MarkedIndex;MarkingIndex--)
|
|
|
{
|
|
|
-
|
|
|
+ if((*gpsMap[MarkingIndex]).roadMode!=6)
|
|
|
+ {
|
|
|
if(MarkingCount<100)
|
|
|
{
|
|
|
if((BackAveFive-FrontAveFive)<3)
|
|
@@ -179,7 +183,7 @@ int iv::decition::Compute00::getDesiredSpeed(std::vector<GPSData> gpsMap)
|
|
|
{
|
|
|
(*gpsMap[MarkingIndex]).roadMode=11; //高速/疯狂加速,大于60米
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
MarkingCount++;
|
|
|
}
|
|
|
}
|