|
|
@ -102,6 +102,7 @@ class RouteEngine: |
|
|
|
new_destination = coordinate_from_param("NavDestination", self.params) |
|
|
|
new_destination = coordinate_from_param("NavDestination", self.params) |
|
|
|
if new_destination is None: |
|
|
|
if new_destination is None: |
|
|
|
self.clear_route() |
|
|
|
self.clear_route() |
|
|
|
|
|
|
|
self.reset_recompute_limits() |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
should_recompute = self.should_recompute() |
|
|
|
should_recompute = self.should_recompute() |
|
|
@ -265,8 +266,7 @@ class RouteEngine: |
|
|
|
if distance_to_maneuver_along_geometry < -MANEUVER_TRANSITION_THRESHOLD: |
|
|
|
if distance_to_maneuver_along_geometry < -MANEUVER_TRANSITION_THRESHOLD: |
|
|
|
if self.step_idx + 1 < len(self.route): |
|
|
|
if self.step_idx + 1 < len(self.route): |
|
|
|
self.step_idx += 1 |
|
|
|
self.step_idx += 1 |
|
|
|
self.recompute_backoff = 0 |
|
|
|
self.reset_recompute_limits() |
|
|
|
self.recompute_countdown = 0 |
|
|
|
|
|
|
|
else: |
|
|
|
else: |
|
|
|
cloudlog.warning("Destination reached") |
|
|
|
cloudlog.warning("Destination reached") |
|
|
|
Params().remove("NavDestination") |
|
|
|
Params().remove("NavDestination") |
|
|
@ -293,6 +293,10 @@ class RouteEngine: |
|
|
|
self.step_idx = None |
|
|
|
self.step_idx = None |
|
|
|
self.nav_destination = None |
|
|
|
self.nav_destination = None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def reset_recompute_limits(self): |
|
|
|
|
|
|
|
self.recompute_backoff = 0 |
|
|
|
|
|
|
|
self.recompute_countdown = 0 |
|
|
|
|
|
|
|
|
|
|
|
def should_recompute(self): |
|
|
|
def should_recompute(self): |
|
|
|
if self.step_idx is None or self.route is None: |
|
|
|
if self.step_idx is None or self.route is None: |
|
|
|
return True |
|
|
|
return True |
|
|
|