Fix smart recalculation problem
This commit is contained in:
parent
33f19e7a95
commit
2d47028aca
2 changed files with 8 additions and 3 deletions
|
@ -746,7 +746,9 @@ public class BinaryRoutePlanner {
|
||||||
RouteSegmentResult res = new RouteSegmentResult(segment.road, parentSegmentStart, segment.segmentStart);
|
RouteSegmentResult res = new RouteSegmentResult(segment.road, parentSegmentStart, segment.segmentStart);
|
||||||
parentSegmentStart = segment.parentSegmentEnd;
|
parentSegmentStart = segment.parentSegmentEnd;
|
||||||
segment = segment.parentRoute;
|
segment = segment.parentRoute;
|
||||||
result.add(res);
|
if(res.getStartPointIndex() != res.getEndPointIndex()) {
|
||||||
|
result.add(res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Collections.reverse(result);
|
Collections.reverse(result);
|
||||||
|
|
||||||
|
@ -756,7 +758,10 @@ public class BinaryRoutePlanner {
|
||||||
RouteSegmentResult res = new RouteSegmentResult(segment.road, segment.segmentStart, parentSegmentEnd);
|
RouteSegmentResult res = new RouteSegmentResult(segment.road, segment.segmentStart, parentSegmentEnd);
|
||||||
parentSegmentEnd = segment.parentSegmentEnd;
|
parentSegmentEnd = segment.parentSegmentEnd;
|
||||||
segment = segment.parentRoute;
|
segment = segment.parentRoute;
|
||||||
result.add(res);
|
// happens in smart recalculation
|
||||||
|
if(res.getStartPointIndex() != res.getEndPointIndex()) {
|
||||||
|
result.add(res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Collections.reverse(result);
|
Collections.reverse(result);
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ public class RoutingHelper {
|
||||||
// if we are still too far try to proceed many points
|
// if we are still too far try to proceed many points
|
||||||
// if not then look ahead only 3 in order to catch sharp turns
|
// if not then look ahead only 3 in order to catch sharp turns
|
||||||
boolean longDistance = dist >= 250;
|
boolean longDistance = dist >= 250;
|
||||||
int newCurrentRoute = lookAheadFindMinOrthogonalDistance(currentLocation, routeNodes, currentRoute, longDistance ? 10 : 3);
|
int newCurrentRoute = lookAheadFindMinOrthogonalDistance(currentLocation, routeNodes, currentRoute, longDistance ? 15 : 8);
|
||||||
double newDist = getOrthogonalDistance(currentLocation, routeNodes.get(newCurrentRoute),
|
double newDist = getOrthogonalDistance(currentLocation, routeNodes.get(newCurrentRoute),
|
||||||
routeNodes.get(newCurrentRoute + 1));
|
routeNodes.get(newCurrentRoute + 1));
|
||||||
if(longDistance) {
|
if(longDistance) {
|
||||||
|
|
Loading…
Reference in a new issue