openpilot
openpilot copied to clipboard
nav: resume route when coming back onroad
If route has not been completed (Maybe check within a limit of so many yards to see if route is complete. Not sure how this is done today? Probably just ends on offroad) cache route on offroad, then grab route when returning to onroad and ask to resume.
- [x] Cache route if route not finished and entering offroad
- [ ] Grab cached route returning to onroad
- [ ] Add UI for resume
It looks like the route is already cached under param "NavDestination" and not cleared until the destination is reached or the user initiates a route clear.
This is one of the mocks we drew up for this feature when we were making the initial design for nav.

That route really lends itself nicely to this design. If the route were mirrored over the y axis the dialog box would be covering the route unless the map was further zoomed out. I think it might be good to have the dialog be a tad shorter and spanning the bottom of the map window. That way you only need to worry about zooming above the dialog instead of checking if the route falls within the dialog boxes area.
I also don't see a clear way for the user to cancel the route. If the dialog spans the full width of the map window there would be room for two buttons maybe resume and end?
Making the dialog wider and shorter is fine with me. Alternatively you can figure out how to rotate the map to make it fit, but that might look confusing if you need more than 45 degrees of rotation.
The plan was to make the dialog go away ~10 seconds after you start moving, or when you close the map window.
I think the new nav entry on the home screen and in the map should cover this use case pretty well.