Sometimes, maneuver completion announcements can happen prematurely.
An example of a driver that's told to make a left turn:
He arrives at the light and stops at the intersection. While he's stationary and waiting for the light to turn, the SDK considers the maneuver complete (presumably because the GPS location moved around slightly) and gives him the next instruction as if he's continued driving. Despite the announcement, the confused user is still waiting for the light to turn green.
@1ec5 proposed a more sophisticated model for determining maneuver state:
Ultimately, we may need to model maneuvers as a state machine rather than reevaluating turn completion factors from scratch on every location update.
Android version of https://github.com/mapbox/mapbox-navigation-ios/issues/222
cc @cammace
Ultimately, we may need to model maneuvers as a state machine rather than reevaluating turn completion factors from scratch on every location update.
Thinking out loud about ways to model a turn: The user is in “approach” mode as they near the maneuver point and “exit” mode as they move away from the maneuver point. The local minimum of the distance to the maneuver point is approximately where the user performs the maneuver. (Depending on the size of the intersection, that local minimum distance may be several meters.)
Somewhere around this actual maneuver location, we’d expect the user’s bearing or course to become more like bearing_after than bearing_before. We’d go from “approach” to “exit” when the distance to the maneuver point starts increasing again and the user’s bearing or course becomes more like bearing_after. We can announce the next maneuver at this point but not before.
@mecoFarid please only open new issues rather than commenting on issues that aren't related.
@danesfeder and I haven't had many issues with this lately on our test drives. I'm removing this from the 0.4.0 milestone for now since this change (if any's needed) won't make it into the next release.
iOS added some logic that helps with early completion announcements, especially on maneuvers that generally go straight: https://github.com/mapbox/mapbox-navigation-ios/pull/378
@cammace might be worth taking another look at this given the recent milestone work
Is this something that @frederoni and @cammace could have a look at?
The local minimum of the distance to the maneuver point is approximately where the user performs the maneuver.
By the way, this same approach is useful for detecting an unexpected U-turn or other rerouting situation: mapbox/mapbox-navigation-ios#646.
Can this be closed now that we are using the voice instructions coming from the directions API? I ported mapbox/mapbox-navigation-ios#646 so that's covered. https://github.com/mapbox/mapbox-navigation-ios/pull/378 I don't believe has been ported and can be if we still want to, just would like some clarification on what this ticket is actually asking for?
@cammace Yeah, the directions API only covers where to make announcements given a certain step, it's still the full responsibility of the SDK to determine exactly when a step is complete and a new step begins.
The OP is now somewhat out of date, and the last remaining issue with premature completion announcements deals with premature completion along off ramps, continue steps, and other steps where the in and out bearing are approximately the same.
Porting over https://github.com/mapbox/mapbox-navigation-ios/pull/378 will address this, and should be prioritized for 0.7.0.
Closing in favor of https://github.com/mapbox/mapbox-navigation-android/issues/578.