Android HERE SDK Turn-by-turn navigation wrong maneuvers

485 Views Asked by At

I am developing a navigation for Android, based on the HERE SDK and the HERE Mobile SDK UI Kit. When calling the HERE API to generate a route, I am using 128 waypoints - the FIRST and the LAST one are from type STOP_WAYPOINT, ALL OTHER are from type VIA_WAYPOINT (pass-through according to the official documentation). After doing some real-driving tests, I noticed that if I leave the planned navigation route, the HERE SDK actually starts showing maneuvers that are leading to the end of the route (the last waypoint that is from STOP_WAYPOINT type), instead returning back to the planned navigation route or more specifically - to the last VIA_WAYPOINT that has not been "passed" while driving. If I return to the route, the SDK keeps showing wrong maneuvers, despite driving on the proper planned route for navigation. Is there any chance to fix that weird behavior?

1

There are 1 best solutions below

2
On

This is a re-routing use case and there are different scenarios how to best handle this. One option is to listen if the user has left the route. As soon as that happens, calculate a new route. Now you have several options, which may depend on your app design:

  • Either take all waypoints into account again (which could mean that the user has to drive back).
  • Or take only specific waypoint types into account.
  • Or ignore all waypoints and route to the destination (if you assume the user is no longer interested into the missed waypoints).

I don't know the exact behavior for the HERE SDK for Android (Premium Edition), but it sounds not wrong to reroute to the destination again ignoring passed waypoints).