Skip to content
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

Enable snapping to closure for the origin of the re-route by default #5664

Closed
LukasPaczos opened this issue Apr 6, 2022 · 6 comments · Fixed by #6050
Closed

Enable snapping to closure for the origin of the re-route by default #5664

LukasPaczos opened this issue Apr 6, 2022 · 6 comments · Fixed by #6050
Assignees
Labels
Core Work related to core navigation and integrations. improvement Improvement for an existing feature.

Comments

@LukasPaczos
Copy link
Member

There are situations where a user can intentionally turn into, or start a route from an edge that is marked a closed. In these situations, the router would continuously try to reroute the user until they leave the closed edge.

However, we could trust or map-matcher more and always allow for snapping to closures for the origin of the route which would prevent continuous reroutes and only attempt to drives us out of the closer as soon as possible.

cc @dudeuter

@LukasPaczos LukasPaczos added Core Work related to core navigation and integrations. improvement Improvement for an existing feature. labels Apr 6, 2022
@LukasPaczos
Copy link
Member Author

cc @mskurydin

@mskurydin
Copy link
Member

mskurydin commented Apr 6, 2022

It's more of a question of whether the routing engine allows starting from such edges. We pass a coordinate of the origin (potentially, with some additional data). Potentially, snapping_include_closures may help here:

image

@LukasPaczos
Copy link
Member Author

Yes, this is exactly the param we'd want to use for the first waypoint of the route.

@dudeuter
Copy link

dudeuter commented Apr 6, 2022

@mskurydin For devices with precached tiles prior to a closure, I'm assuming nav-native will happily match to them. But do the nav-native tiles contain closures, and if so will enhanced location avoid closures?

@LukasPaczos with respect to snapping_include_closures do we already imply that the expected default behavior of a route request is to start at the current location of the vehicle?

For example even in:

/**
* Takes a list of [Point]s and correctly adds them as waypoints in the correct order.
*
* @receiver RouteOptions.Builder
* @param origin Point
* @param waypoints List<Point?>?
* @param destination Point
* @return RouteOptions.Builder
*/
@JvmOverloads
fun RouteOptions.Builder.coordinates(
origin: Point,
waypoints: List<Point>? = null,
destination: Point
): RouteOptions.Builder {

We accept a Point for the origin parameter instead of a LocationProvider, so it's not explicit that the origin should always be the device position.

I suppose we could add an extension function that does accept a LocationProvider for the origin waypoint, and also sets this (and possibly other Directions API parameters that may help in the case that we're assuming LocatonProvider will know that we're on a road).

@LukasPaczos
Copy link
Member Author

Circling back to this ticket, @browndp08 @stari4ek should Nav SDKs default to including the origin of the route in snapping_include_closures?

do we already imply that the expected default behavior of a route request is to start at the current location of the vehicle?

We don't for the initial route request, we do for reroutes though, and we have a utility on the way that would pick the current vehicle's location automatically also for initial requests - #5427.

@LukasPaczos LukasPaczos changed the title Enable snapping to closure for the origin of the route by default Enable snapping to closure for the origin of the re-route by default Jul 13, 2022
@LukasPaczos
Copy link
Member Author

Capturing from the team discussion, renaming the ticket to track the change to our re-route controller to apply snapping_include_closures=true for the origin of each re-route request. The default request can remain as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Work related to core navigation and integrations. improvement Improvement for an existing feature.
Projects
None yet
3 participants