New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
navd: fix hysteresis when reaching destination #29032
Conversation
|
This is the fixed behavior, before this, it would briefly show that you've arrived, then disappear. Includes fixed nav banner instructions from #29034 in the video you.have.arrived.fixed.2.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the distance in the top banner too?
|
||
# Clear route if driving away from destination | ||
dist = self.nav_destination.distance_to(self.last_position) | ||
if dist > REROUTE_DISTANCE: | ||
self.params.remove("NavDestination") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to clear route instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't, it's used to temporarily hide the route on errors as well. It's intentional there's still a NavDestination but no route
nav.arrived.and.left.mp4 |
Noticed this when reading the code to start refactoring. Basically, the desired behavior (from the comments) is that you reach your destination, stop, but nothing is cleared until you start driving away:
openpilot/selfdrive/navd/navd.py
Lines 271 to 277 in 5cfb79e
However since we clear the parameter first, we clear the route anyway on the next loop:
openpilot/selfdrive/navd/navd.py
Lines 102 to 105 in 5cfb79e
We can avoid clearing the param until we clear the route and don't need to worry about re-routing due to this check here:
openpilot/selfdrive/navd/navd.py
Lines 300 to 302 in 5cfb79e