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

LocationRelay needs update #419

Closed
kellyschrock opened this issue Jul 26, 2016 · 2 comments
Closed

LocationRelay needs update #419

kellyschrock opened this issue Jul 26, 2016 · 2 comments

Comments

@kellyschrock
Copy link
Contributor

LocationRelay has two issues when used with Follow in CLIENT_SPECIFIED mode:

It rejects incoming locations that don't have a heading, accuracy, and time. It doesn't actually need heading for anything, which means that applications supplying external locations to the API have to specify an arbitrary heading just to get LocationRelay to accept it. This requirement should be moved.

The currentSpeed calculation falls apart for incoming location intervals of < 1 second, returning 0 for something as straightforward as (0.5 meter distance in 500ms). This failure affects the average speed, which makes subsequent locations more likely to be rejected.

kellyschrock added a commit to kellyschrock/DroneKit-Android that referenced this issue Jul 26, 2016
@m4gr3d
Copy link
Member

m4gr3d commented Jul 26, 2016

@kellyschrock The location heading is being used when generating the gcs location, and is then used by some of the Follow algorithm like FollowSplineAbove, so it's actually needed.

@m4gr3d
Copy link
Member

m4gr3d commented Jul 26, 2016

@kellyschrock as an alternative, the location relay class can detect when the received location has no bearing, and compute a bearing using GeoTools#getHeadingFromCoordinates(...) passing the new location, and the last received location.
It will then use that bearing when creating the gcs location if the received location has no bearing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants