mapbox / mapbox/mapbox-navigation-android

[MapboxReplayer] Use a curve to calculate the speed profile for simulating routes

Open
#5,682 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

jira-sync-complete
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

![Screen Shot 2022-04-07 at 4 57 14 PM](https://user-images.githubusercontent.com/3021882/162337773-a010929f-f08f-4823-bb97-b5cfa1c2978e.png)

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.