Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Expose option to pass intermediate points for smooth location animation #166

Merged
merged 2 commits into from
Feb 11, 2020

Conversation

LukasPaczos
Copy link
Member

This PR adds a LocationComponent#forceLocation overload, which allows passing a list of locations. The last location in the list is the desired target, while everything else makes up for the intermediate points in the otherwise linear location puck animation. This allows for better road geometry tracking and avoids "cutting" corners when 2 raw updates are on the opposite side of an intersection maneuver.

This also exposes a lookAheadUpdate flag in the same method. If we have an ability to predict location updates, setting this flag to true will take the timestamp of the target location (last in the list) and calculate the animation duration equal to

targetLocationTimestamp - currentTimestamp

This allows minimizing the visual lag that a smooth animation would introduce otherwise.

/cc @SiarheiFedartsou @mskurydin

@LukasPaczos LukasPaczos requested review from Guardiola31337 and a team February 6, 2020 17:20
@chloekraw
Copy link
Contributor

@LukasPaczos neat idea. do we have any metrics on the performance diff with this change?

@LukasPaczos
Copy link
Member Author

I don't have data, but there should be no perf difference. Normally, the framework would interpolate between A->B with an arbitrary amount of intermediate points (system determines that based on the framerate). While now, the system will still fill in some intermediate points, but we're also making it possible to define a fixed amount of them which the system will have to visit giving us a chance to better shape the path.

Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

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

:shipit:

Guardiola31337 added a commit to mapbox/mapbox-navigation-android that referenced this pull request Feb 7, 2020
@Guardiola31337
Copy link
Contributor

@LukasPaczos
Copy link
Member Author

Thanks @Guardiola31337 👍

@LukasPaczos LukasPaczos merged commit 1b5aeeb into master Feb 11, 2020
@LukasPaczos LukasPaczos deleted the lp-location-intermediate-points branch February 11, 2020 12:37
LukasPaczos pushed a commit to mapbox/mapbox-navigation-android that referenced this pull request Feb 12, 2020
Guardiola31337 added a commit to mapbox/mapbox-navigation-android that referenced this pull request Feb 12, 2020
…2452)

* expose list of key points leading up to the enhanced location update

* fix SimpleMapboxNavigation example

* use env or project variables for bintray credentials

* updated licenses

* fix http client tests

* bump mapboxMapSdk version to 9.0.0-20200207.215725-27 (mapbox/mapbox-gl-native-android#166) which includes fix for mapbox-gl-native mapbox/mapbox-gl-native#16180 crash

* Follow up from #2452 (#2458)

* make configure router http interface parameter nullable

* add nn uncertain route state

* expose nn cache last route api in mapbox navigator

* remove lat long workaround not needed anymore as nn master-SNAPSHOT-0 includes the fix

* bump mapbox-navigation-native version to ms-bearing-from-shape-on-interpolation-SNAPSHOT-2

* bumped maps sdk to the latest 9.1.0-SNAPSHOT

* update MapboxTripSession tests

* update SimpleMapboxNavigation example log level

* remove explicit Bintray env variables declaration on CI

Co-authored-by: Pablo Guardiola <guardiola31337@gmail.com>
@tobrun tobrun added this to the release-vanilla-shake milestone Feb 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants