mapbox / mapbox/mapbox-navigation-android
[MapboxReplayer] Use a curve to calculate the speed profile for simulating routes
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
The replayer does not have perfect "distance" and "speed" calculations. We can improve the driver speed in order to make it exact. The speed accelerations are linear, but we could introduce a curve. The [hermite curve](https://en.wikipedia.org/wiki/Cubic_Hermite_spline) feels perfect for this

We want to speed and distance calculations to be exact, and then we create our own imperfect scenarios.
Here is where the speed profile is calculated
https://github.com/mapbox/mapbox-navigation-android/blob/3b9bbcc97bfc719c168392faf59333c91bf92eda/libnavigation-core/src/main/java/com/mapbox/navigation/core/replay/route/ReplayRouteInterpolator.kt#L18-L29
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 with libnavigation-core/src/main/java/com/mapbox/navigation/core/replay/route/ReplayRouteInterpolator.kt at the linked speed-profile calculation. Review how the current linear acceleration affects replayed speed and distance, then determine how a Hermite curve should produce exact calculations. Done means the replayer uses the curve-based profile and speed and distance calculations are exact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100