mapbox / mapbox/mapbox-navigation-android
MapboxReplayer with a current location repeater
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
Creating a ticket to describe something in replay that could resolve issues like https://github.com/mapbox/mapbox-navigation-native/issues/1249. Opening up for discussion before building because the systems are depending on each other.
### Typical GPS providers
GPS providers will create a calculated location once per second. There are ways to request limited location updates based on the [location displacement](https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest#setSmallestDisplacement(float)). The smallest displacement says the location should not be updated if the previous location is near the current one. This is the same behavior as an error case that causes positioning issues, the location provider goes stale.
### Navigator problem
The navigator depends on a few data points to "believe" the data. This is good to handle stale locations. But it also means there are states that it will filter small displacement (aka stopped locations) signals because they will be considered stale or uncertain.
### Ideas
We can build into replay a way to configure location repeating. The location closest to the player's current position (like a music player, the position in the song when you're paused). Whatever that location is, repeat it once per second. This doesn't solve identifying small displacement filtering in our production case - jury is still out on that one.
#### Implementation
1. Create new `MapboxReplayer.playLocationRepeater(interval: Long, units: TimeUnit)`
or (`MapboxReplayer.enableLocationRepeater(interval: Long, units: TimeUnit)` and `MapboxReplayer.disableLocationRepeater()`)
1. ~Build the repeater into ReplayLocationEngine which can be enabled or disabled~ does not work with `startReplayTripSession`
1. ~Repurpose playFirstLocation() to do this.~ cannot do because SEMVER
1. Something else
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 reviewing MapboxReplayer, ReplayLocationEngine, and the startReplayTripSession path, along with the linked navigation issue. Clarify the API and lifecycle for enabling location repetition before implementation. Done means replay can repeat the location nearest the player's current position at a configurable interval without changing existing playFirstLocation behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100