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

RouteController drops batched location updates #949

Closed
1ec5 opened this issue Dec 20, 2017 · 5 comments
Closed

RouteController drops batched location updates #949

1ec5 opened this issue Dec 20, 2017 · 5 comments
Labels

Comments

@1ec5
Copy link
Contributor

1ec5 commented Dec 20, 2017

CLLocationManagerDelegate.locationManager(_:didUpdateLocations:) accepts an array of locations in chronological order, but we drop all but the latest in any given location update:

@objc public func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
guard let location = locations.last else {
return
}
self.rawLocation = location

Sometimes location updates occur in a burst. If the user is traveling along a straight path, the older locations don’t matter. But if they’re traveling along a curve or turning at an intersection, the dropped locations could significantly affect camera movement.

/ref #939 mapbox/mapbox-gl-native#3610
/cc @mapbox/navigation-ios

@1ec5 1ec5 added bug Something isn’t working topic: camera topic: location labels Dec 20, 2017
@bsudekum
Copy link
Contributor

Oooooo let's definitely not throw out data.

@ericrwolfe
Copy link
Contributor

Is this a real issue? Are there concrete examples of issues with camera movements caused by missed location bursts?

From past experience, bursts of locations in didUpdateLocations generally only occur when 1) first starting a location manager and didUpdateLocations immediately returns a set of cached/stale locations and 2) when using allowDeferredLocationUpdates(untilTraveled:timeout:).

@1ec5
Copy link
Contributor Author

1ec5 commented Dec 21, 2017

You’re right, I can’t say that this is a real issue in practice (emphasis on could above). However, we’re starting to talk about inserting maneuver locations and other control points between actual location updates in order to stabilize the camera and puck, so it seems natural that we’d use these extra locations – if any – to better model the road.

@bsudekum
Copy link
Contributor

Noting we now filter out unqualified locations, however we still look at the last item in this array of qualified locations.

@1ec5
Copy link
Contributor Author

1ec5 commented Jul 14, 2020

Since the migration to MapboxNavigationNative, RouteController sends all locations to the navigator.

@1ec5 1ec5 closed this as completed Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants