mapbox / mapbox/mapbox-navigation-android
Custom Simulation Integration Issues and MapBoxReplayer Control Problems in MapBox Navigation SDK
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
Android API: 33
Mapbox Navigation SDK version: 2.17.3
Steps to trigger behavior
1. Use MapBoxReplayer or ReplayRouteSession for navigation simulation.
2. Implement a custom simulation as an alternative due to issues with MapBoxReplayer.
3. Encounter problems with data integration from the custom simulation into MapBox.
Expected behavior
- MapBoxReplayer should respond appropriately to stop() and finish() commands.
- Seamless integration of custom simulation data into MapBox, affecting route progress and location updates.
Actual behavior
- MapBoxReplayer does not adequately respond to stop() and finish() commands during navigation.
- Challenges in integrating custom simulation data into MapBox, specifically affecting route progress updates and location data utilization.
Issue Description:
I am experiencing issues with MapBoxReplayer and ReplayRouteSession, particularly in controlling the simulation speed and responding to stop() and finish() commands. The vehicle in the simulation continues to move as if being pushed forward, regardless of these commands.
To address this, I decided to implement a custom simulation. However, this led to additional challenges in integrating the custom simulation data with MapBox. Here's a snippet of my CustomLocationEngine setup:
init {
customLocationProvider.addLocationUpdateListener { newLocation ->
val result = LocationEngineResult.create(newLocation)
for (callback in locationCallbacks) {
callback.onSuccess(result)
}
}
}
The custom simulation data, triggered by CustomLocationProvider, does not seem to be effectively used by MapBox internals. I've noticed discrepancies in data usage, particularly in RouteProgressObserver and LocationObserver. While LocationObserver's onNewRawLocation seems to receive the correct data, RouteProgressObserver's onRouteProgressChanged and LocationObserver's onNewLocationMatcherResult appear to be using data from an unknown source.
This presents a significant problem as I rely on routeProgress data in RouteProgressObserver for various functionalities. I need guidance on how to ensure that my custom simulation data is properly integrated and utilized by MapBox. Is there a recommended approach or a solution to ensure the custom simulation data is accurately reflected in MapBox's navigation updates? Or maybe you could provide a proper way of using MapBoxReplayer with the ability to set speed, pause simulation etc?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior with MapBoxReplayer or ReplayRouteSession on Android API 33 using SDK 2.17.3, then trace the CustomLocationProvider callbacks into LocationObserver and RouteProgressObserver. Compare the data received by onNewRawLocation, onNewLocationMatcherResult, and onRouteProgressChanged while testing stop() and finish(). Done means the source of route progress and location updates is understood and the reported control or integration behavior is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100