Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HistoryReader for navigation replay #4601

Merged
merged 1 commit into from
Jul 21, 2021
Merged

Conversation

kmadsen
Copy link
Contributor

@kmadsen kmadsen commented Jul 13, 2021

Description

Resolves #4485

Adding the ability to replay pbf.gz files. Deleting the old path to replay only json files. This will continue to support the old json format, but you have to pass the file path to the MapboxHistoryReader.

I have not found a way to read the *.pbf.gz formatted files in the assets or raw resource directories. I've had to copy the files into my device storage, and then read the file directly from there.

Changelog

<changelog>
Delete `ReplayHistoryDTO` in favor of `MapboxHistoryReader`.
Add eventTimestamp to all `HistoryEvent` classes.
Delete `CustomEventMapper` in favor of `ReplayHistoryEventMapper`
Create new `ReplayHistoryMapper` which is extendable and customizable
</changelog>

Screenshots or Gifs

val mapper = ReplayHistoryMapper.Builder()
    .statusMapper(null)
    .addPushEventMapper(fooEventMapper)
    .addPushEventMapper(initialRouteMapper)
    .build()

val replayEvents = MapboxHistoryReader(outputFile.absolutePath).asSequence()
    .mapNotNull { mapper.mapToReplayEvent(it) }
    .toList()

mapboxReplayer.clearEvents()
mapboxReplayer.pushEvents(replayEvents)
mapboxReplayer.play()
replay-test.mp4

@kmadsen kmadsen force-pushed the km-replay-with-history-reader branch 9 times, most recently from e61e9d7 to c7cdbb4 Compare July 16, 2021 05:22
@kmadsen kmadsen mentioned this pull request Jul 16, 2021
@kmadsen
Copy link
Contributor Author

kmadsen commented Jul 16, 2021

Robo tests seem to be failing because of this https://github.com/mapbox/mapbox-navigation-native/issues/3583

@kmadsen kmadsen marked this pull request as ready for review July 16, 2021 18:49
@kmadsen kmadsen requested a review from a team as a code owner July 16, 2021 18:49
@kmadsen kmadsen force-pushed the km-replay-with-history-reader branch 2 times, most recently from 30fb7da to 53aec7b Compare July 19, 2021 19:53
@kmadsen kmadsen force-pushed the km-replay-with-history-reader branch 3 times, most recently from 1bcc677 to 760d40e Compare July 20, 2021 19:54
Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments @kmadsen

@kmadsen kmadsen force-pushed the km-replay-with-history-reader branch from 760d40e to 9402a12 Compare July 21, 2021 15:42
@kmadsen kmadsen added the backwards incompatible Requires a SEMVER major version change. label Jul 21, 2021
@kmadsen kmadsen force-pushed the km-replay-with-history-reader branch 2 times, most recently from 5fb2396 to 8074a83 Compare July 21, 2021 15:46
Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the feedback 🚀

@kmadsen kmadsen force-pushed the km-replay-with-history-reader branch from ffa1e66 to 51b803a Compare July 21, 2021 19:08
@kmadsen kmadsen merged commit 88c20e9 into main Jul 21, 2021
@kmadsen kmadsen deleted the km-replay-with-history-reader branch July 21, 2021 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards incompatible Requires a SEMVER major version change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the HistoryReader for replay
2 participants