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

Location jump in Follow-Me mode #1128

Closed
kellyschrock opened this issue Oct 5, 2014 · 13 comments
Closed

Location jump in Follow-Me mode #1128

kellyschrock opened this issue Oct 5, 2014 · 13 comments

Comments

@kellyschrock
Copy link
Contributor

On 3 occasions after starting Follow-Me mode and starting to move in a specific direction, the UAV follows for a minute or so, then flies suddenly away to a point 10-20 meters away. Then it starts following again. This is without any changes to the FollowMode, and always happens within a minute or so of me starting to move. Prior to starting Follow-Me mode, I'm not moving around from the point where my Android device first acquires a GPS fix when this happens. And, prior to starting DroidPlanner, I'm not using any apps that receive GPS locations.

Android Location accuracy changes fairly dramatically between the first fix and subsequent ones acquired when the device is on the move. Accuracy as high (bad) as 80 meters, and as low (good) as 2. It seems reasonable to think that as it changes, it could cause a "jump" in the Android device location sent to the UAV, causing it to fly to the new spot suddenly. In Follow.java, I see a check for location accuracy of < 10.0, but if the change in accuracy is what's causing these jumps, it seems like something else may be needed. Something tracking the distance between locations as they arrive, and ignoring them if the results are spurious.

I could be wrong about what's causing it, but I thought I would log the issue in any case. The sudden flight to an unexpected location can be kind of hard to manage.

kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 5, 2014
Ignore location updates in Follow-Me which cause a
sudden jump in location.

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 5, 2014
Ignore location updates in Follow-Me which cause a
sudden jump in location.

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 5, 2014
Ignore location updates in Follow-Me which cause a
sudden jump in location.

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 5, 2014
Ignore location updates in Follow-Me which cause a
sudden jump in location.

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 5, 2014
Ignore location updates in Follow-Me which cause a
sudden jump in location.

Fixes DroidPlanner#1128
@PaulLoizeaux
Copy link

A concern I have about this is that the change will only allow Follow Me to operate below 15 meters per second.

Having this as a user selectable preference would probably be best. Someone trying to use this in a car (hopefully on a closed road etc.) or to chase another plane or smaller vehicle (RC car, four wheeler) won't work if they go above 15 meters per second.

@kellyschrock
Copy link
Contributor Author

@PaulLoizeaux I was thinking about this too. 15 m/s is kind of arbitrary. As an improvement (or an amendment to this change), I could also track average speed, and only accept new locations if they indicate a speed within some reasonable range of the average. E.g. if the average speed is 10 m/s and suddenly seems to jump to 30, the new location would be filtered. What do you think about be a reasonable speed difference threshold to accept in that case?

@squilter
Copy link
Member

squilter commented Oct 5, 2014

ArduPilot has a GPS glitch detector. Maybe check that out? But are we sure that a gps glitch was even the problem? It seems like that FusedLocation would have somehow filtered that out already.

@kellyschrock
Copy link
Contributor Author

@squilter I'm heading out in a few minutes to do some more testing, and validate it's actually the problem. Initial tests this morning didn't show the problem, but I'd like to be sure.

@kellyschrock
Copy link
Contributor Author

Just came back from another round of testing. I took care to not get a GPS fix on the Android device before starting DroidPlanner, and got no sudden moves once I started Follow-Me and started walking. Accuracy was ~40m at first. It did hesitate to follow at one point, which it might have been doing instead of running off to find me at the spurious location.

I looked at FusedLocationProvider, and didn't see anything that looked like it's filtering for spurious locations.

@arthurbenemann
Copy link
Member

@kellyschrock Thanks for testing this out. Note that since v2.7.10-rc2 the UI now shows when the follow-me code is still waiting for a GPS lock (Red button) or is running (blue state).

@kellyschrock
Copy link
Contributor Author

I noticed that yesterday, and I think it's a handy feature. This problem
appears to be the result of what happens after it gets a GPS lock, but
before it settles down. Right after getting a lock, the accuracy begins to
improve, and the location occasionally jumps around. I observed a jump of
about 60 meters yesterday. Filtering location updates for accuracy (as in
Follow.java) doesn't address the problem, so I have a branch that filters
location updates with a high apparent speed. That appears to fix the
problem, but it also limits the UAV to speeds below 15 meters/second. So
I'm working on another branch that filters location updates indicating a 4x
increase over average speed. I'll test that one this evening or tomorrow.

Thanks,
Kelly

@squilter
Copy link
Member

squilter commented Oct 6, 2014

@kellyschrock What phone are you using? This might have to do with the GPS module in it, since I don't think I've ever seen this happen.

@kellyschrock
Copy link
Contributor Author

I've tested and seen this specific issue on a Nexus 5, Nexus 7, and Nexus
10. I've seen the phenomenon that's causing it on many more phones than
that over the past 5 years (I've built a fair number of Android
applications for a living for that long, and the ones at Garmin are
concerned specifically with location).

To see the issue, open any app that uses GPS (Maps, etc), after waking the
device up with no GPS lock. As soon as you see the dot representing your
location on the map, zoom into it, and watch it jump around a few times
while the accuracy improves. It will take about 10-20 seconds to stabilize.
I can stand in my yard and watch my blue dot jump from the far side of my
neighbor's back yard to my front yard within that time, and finally find
its way to within 8 meters of where I actually am. All with an accuracy of
< 10 meters. It doesn't indicate a problem with the phone, its GPS module,
or the app. It's just the process of getting a decent fix.

It's perfectly normal to pull a phone out of your pocket, hook the
telemetry radio to it, start DroidPlanner, and click "Follow". The entire
operation takes less time than it takes to get a stable GPS location in an
app, and while the location is jumping around, the UAV will be doing the
same thing without some way to counteract it. It doesn't happen every time,
but when it does, I can say from experience that it ranges from annoying
(copter flies suddenly away) to very annoying (copter tries to fly
suddenly away, hits something and crashes). Trying to manage the situation
while holding onto a tablet and the TX and whatever bicycle you're
preparing to be filmed on is a lot to deal with. :-)

On Mon, Oct 6, 2014 at 1:31 PM, squilter [email protected] wrote:

@kellyschrock https://github.com/kellyschrock What phone are you using?
This might have to do with the GPS module in it, since I don't think I've
ever seen this happen.


Reply to this email directly or view it on GitHub
#1128 (comment)
.

@squilter
Copy link
Member

squilter commented Oct 6, 2014

Yes, I've seen that before. We even discussed it a bit in the googlegroup, but never found a good solution.

You said:
the UAV follows for a minute or so, then flies suddenly away to a point 10-20 meters away.
It's the minute or so that made me think you were talking about a different issue.

@kellyschrock
Copy link
Contributor Author

After testing for a couple of hours yesterday, I was fairly confident the
filtering code I was testing was doing the job. There was a number of times
when my location was jumping around on the screen after getting a GPS fix.
During that time, the copter basically hovered in place, and didn't make
any moves.

What I don't like about the solution is the upper limit of 15 m/s. I have
another branch I'm working on that tries to filter based on some value
above average speed, but haven't done much testing with it yet. The idea
with that is to not limit it to some arbitrary top speed.

Another option would be to replace the 15 m/s limit with a user-specified
limit, accessible in settings. Something like "Limit speed to [x
meters/second] in Follow-Me mode" or similar. What do you think?

On Mon, Oct 6, 2014 at 2:15 PM, squilter [email protected] wrote:

Yes, I've seen that before. We even discussed it a bit in the googlegroup
https://groups.google.com/forum/#!topic/droidplanner/sI9owXjZI2Y, but
never found a good solution.

You said:
the UAV follows for a minute or so, then flies suddenly away to a point
10-20 meters away.
It's the minute or so that made me think you were talking about a
different issue.


Reply to this email directly or view it on GitHub
#1128 (comment)
.

@squilter
Copy link
Member

squilter commented Oct 6, 2014

Take a look at the Ardupilot gps glitch detector which I linked to above.

@kellyschrock
Copy link
Contributor Author

I looked at that not long ago, and the idea behind what I'm doing is
similar. Obviously not taking accelerometer input into account.

On Mon, Oct 6, 2014 at 2:28 PM, squilter [email protected] wrote:

Take a look at the Ardupilot gps glitch detector which I linked to above.


Reply to this email directly or view it on GitHub
#1128 (comment)
.

kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Ignore location updates in Follow-Me which cause a
sudden jump in location.

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Ignore location updates in Follow-Me which cause a
sudden jump in location.

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Filter out spurious location updates using average speed
(vs. arbitrary speed limit).

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Filter out spurious location updates using average speed
(vs. arbitrary speed limit).

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Filter out spurious location updates using average speed
(vs. arbitrary speed limit).

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Filter out spurious location updates using average speed
(vs. arbitrary speed limit).

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Filter out spurious location updates using average speed
(vs. arbitrary speed limit).

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Filter out spurious location updates using average speed
(vs. arbitrary speed limit).

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Filter out spurious location updates using average speed
(vs. arbitrary speed limit).

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Filter out spurious location updates using average speed
(vs. arbitrary speed limit).

Fixes DroidPlanner#1128
kellyschrock added a commit to kellyschrock/droidplanner that referenced this issue Oct 7, 2014
Filter out spurious location updates using average speed
(vs. arbitrary speed limit).

Fixes DroidPlanner#1128
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

4 participants