Skip to content

Conversation

kmadsen
Copy link
Contributor

@kmadsen kmadsen commented Jan 19, 2023

Description

We now have a very simple way to replay routes with TripSessionStarter and ReplayRoutesSession. What we want, is to add the ability to replay history. For this I'm adding a way to enable it through the TripSessionStarter so you can switch between replaying routes, regular active guidance, and replaying history. I'm also adding a ReplayHistorySession so we can isolate the logic for tests and use it for solutions that only need to replay a history file.

Unblocking https://mapbox.atlassian.net/browse/NAVAND-804

Examples

Using MapboxNavigationApp and the MapboxTripStarter.

    private val mapboxTripStarter = MapboxTripStarter.getRegisteredInstance()
        .enableReplayHistory(
            options = ReplayHistorySessionOptions.Builder()
                .filePath(getHistoryFile())
                .build()
        )

Using ReplayHistorySession and MapboxNavigation directly.

    private val replayHistorySession = ReplayHistorySession()
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)

        replayHistorySession.onAttached(mapboxNavigation)
        replayHistorySession.setHistoryFile(getHistoryFile())
   }

   override fun onDestroy() {
        super.onDestroy()
        replayHistorySession.onDetached(mapboxNavigation)
   }

@github-actions
Copy link

github-actions bot commented Jan 19, 2023

Changelog

Features

  • Introduced ReplayHistorySession and ReplayHistorySessionOptions to simplify the implementation for replaying history files. History can also be enabled with MapboxTripStarter.enableReplayHistory(). This can replay large history files in a memory efficient way. [#6855](https://github.com/mapbox/mapbox-navigation-android/pull/6855)
  • Added RoadComponent.language value. [#6833](https://github.com/mapbox/mapbox-navigation-android/pull/6833)
  • ⚠️ Changed EHorizonEdgeMetadata.names class from RoadName to RoadComponent. [#6833](https://github.com/mapbox/mapbox-navigation-android/pull/6833)
    To migrate change your code from:
val shielded = roadName.shielded

into:

val shielded = roadComponent.shield != null
  • Added support for continuous EV alternatives in NavigationRouteAlternativesObserver. [#6833](https://github.com/mapbox/mapbox-navigation-android/pull/6833)
  • Fixed issues with map-matching to HOV-only roads. [#6833](https://github.com/mapbox/mapbox-navigation-android/pull/6833)
  • Set a limit of simultaneously running onboard route requests to avoid too many tasks blocking too much of the device's computing resources. [#6833](https://github.com/mapbox/mapbox-navigation-android/pull/6833)
  • Fixed an issue with Road Access Policy ignoring the setting to map-match to closed road sections, when enabled. [#6833](https://github.com/mapbox/mapbox-navigation-android/pull/6833)
  • Added MapboxTripStarter to simplify the solution for managing the trip session and replaying routes. This also makes it possible to share the replay state between drop-in-ui and android-auto. [#6794](https://github.com/mapbox/mapbox-navigation-android/pull/6794)

Bug fixes and improvements

  • Increased max distance from the user indicator to route line valid to continue vanishing updates from 3m to 10m. [#6854](https://github.com/mapbox/mapbox-navigation-android/pull/6854)
  • Fixed an issue where alternative routes might have had an incorrect or incomplete portion of the route refreshed or occasionally fail to refresh. [#6848](https://github.com/mapbox/mapbox-navigation-android/pull/6848)
  • Removed NavigationRoute#hasUnexpectedClosures and added RouteProgress#hasUnexpectedUpcomingClosures instead that checks whether route has upcoming unexpected closures (the algorithm does not take into account closures that the puck has already been on) [#6841](https://github.com/mapbox/mapbox-navigation-android/pull/6841)
  • Improved NavigationView camera behavior to go back into overview state if routes change during route preview state. [#6840](https://github.com/mapbox/mapbox-navigation-android/pull/6840)
  • Improved NavigationView camera behavior to ignore keyboard insets. [#6845](https://github.com/mapbox/mapbox-navigation-android/pull/6845)

Known issues ⚠️

Other changes

Android Auto Changelog

Features

  • Added support for Junction Views. [#6849](https://github.com/mapbox/mapbox-navigation-android/pull/6849)

Bug fixes and improvements

  • Optimized SpeedLimitWidget memory usage. [#6859](https://github.com/mapbox/mapbox-navigation-android/pull/6859)

@kmadsen kmadsen force-pushed the NAVAND-804-km-replay-history branch 2 times, most recently from 489d9e7 to 4d9d25d Compare January 24, 2023 21:01
@Zayankovsky
Copy link
Contributor

Do we need to add functions to NavigationViewApi?

@kmadsen kmadsen force-pushed the NAVAND-804-km-replay-history branch from 4d9d25d to 264460d Compare January 24, 2023 21:46
@codecov
Copy link

codecov bot commented Jan 24, 2023

Codecov Report

Merging #6855 (2ecee1c) into main (2ecee1c) will not change coverage.
The diff coverage is n/a.

❗ Current head 2ecee1c differs from pull request most recent head c9b1ec0. Consider uploading reports for the commit c9b1ec0 to get more accurate results

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #6855   +/-   ##
=========================================
  Coverage     72.68%   72.68%           
  Complexity     5572     5572           
=========================================
  Files           782      782           
  Lines         30166    30166           
  Branches       3562     3562           
=========================================
  Hits          21926    21926           
  Misses         6814     6814           
  Partials       1426     1426           

@kmadsen kmadsen force-pushed the NAVAND-804-km-replay-history branch 2 times, most recently from 7478151 to 59ebc54 Compare January 24, 2023 22:53
@kmadsen
Copy link
Contributor Author

kmadsen commented Jan 25, 2023

Do we need to add functions to NavigationViewApi?

Yeah we do. I'm also thinking we should interact directly with MapboxTripStarter while it is experimental. That way we can flush out any experience issues before deciding on the concrete NavigationViewApi

I'm also not positive on what I think the NavigationViewApi should be. Here are the existing functions. At the very least we need to pass in a history file path, but what about error handling, what about the other options? So I'm thinking it deserves more consideration.

@kmadsen kmadsen force-pushed the NAVAND-804-km-replay-history branch 2 times, most recently from 74a3e1a to 910ecda Compare January 25, 2023 22:37
@kmadsen kmadsen marked this pull request as ready for review January 25, 2023 22:38
@github-actions github-actions bot requested review from dzinad and RingerJK January 25, 2023 22:38
@kmadsen kmadsen changed the title Add a ReplayRouteSession Add a ReplayHistorySession Jan 25, 2023
@kmadsen kmadsen force-pushed the NAVAND-804-km-replay-history branch 3 times, most recently from d955746 to 74eb6d3 Compare January 26, 2023 17:32
@kmadsen kmadsen force-pushed the NAVAND-804-km-replay-history branch from 74eb6d3 to 68328c2 Compare January 26, 2023 18:09
@kmadsen kmadsen force-pushed the NAVAND-804-km-replay-history branch from 68328c2 to c9b1ec0 Compare January 26, 2023 20:46
@kmadsen kmadsen merged commit 02e69a1 into main Jan 26, 2023
@kmadsen kmadsen deleted the NAVAND-804-km-replay-history branch January 26, 2023 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants