maplibre / maplibre-navigation-android

Maplibre Navigation SDK for Android
MIT License
84 stars 41 forks source link

Puck indicator is not keeping up with the device actual location #108

Closed javaherisaber closed 1 month ago

javaherisaber commented 2 months ago

Android API: 26-33 Maplibre Navigation SDK version: 3.0.0

When driving to a destination, the Puck (MyLocation) indicator is getting behind the current device location which is misleading during navigation for example, I get past an intersection in real, but the map shows 10-20 meters behind

Fabi755 commented 1 month ago

This is a known problem of the MapLibre native project.

The biggest problem is the implementation of the animation for the movement of the puck.

If you are using the raw GPS information, the puck is jumping and moves jerkily every second to the current position. For a smooth view, the puck is animated. This animation is calculated from the last position to the newest position. The duration is calculated also for a second. When the animation ends, the puck is then on the current location. But the real location has also moved forward and is not no longer up to date.

With this implementation the location puck is always a step behind. A solution were to use the current position as start point and calculate the most probable future point. @boldtrn has mentioned the Kalman filter for this.

Feel free to start working and create a PR for this topic :-)

Fabi755 commented 1 month ago

Closed. Not part of the navigation project.