|
@@ -512,9 +512,14 @@ int iv::decition::Compute00::getNearestPointIndex(GPS_INS rp, const std::vector<
|
|
int preDistance=max(100,(int)(rp.speed*10));
|
|
int preDistance=max(100,(int)(rp.speed*10));
|
|
preDistance=min(500,preDistance);
|
|
preDistance=min(500,preDistance);
|
|
|
|
|
|
- int startIndex = max((int)(lastIndex - 100),(int)(lastIndex-map_size)); // startIndex = 0 则每一次都是遍历整条地图路线
|
|
|
|
- int endIndex = min((int)(lastIndex + preDistance ),(int)(lastIndex+map_size));
|
|
|
|
-
|
|
|
|
|
|
+ //int startIndex = max((int)(lastIndex - 100),(int)(lastIndex-map_size)); // startIndex = 0 则每一次都是遍历整条地图路线
|
|
|
|
+ int endIndex = min((int)(lastIndex + preDistance ),(int)(map_size-1));
|
|
|
|
+ int startIndex=0;
|
|
|
|
+ if(lastIndex>100){
|
|
|
|
+ startIndex = max((int)(lastIndex - 100),(int)(lastIndex-map_size));
|
|
|
|
+ }else{
|
|
|
|
+ startIndex=0;
|
|
|
|
+ }
|
|
|
|
|
|
for (int j = startIndex; j < endIndex; j++)
|
|
for (int j = startIndex; j < endIndex; j++)
|
|
{
|
|
{
|