osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.69k stars 1.02k forks source link

Use GPS heading (not compass) when available for marker direction arrows #3214

Open njohnston opened 8 years ago

njohnston commented 8 years ago

I'm using OsmAnd+ 2.4.7 on a Samsung Galaxy S5 with Android 6.0.1.

On several occasions, I've noticed that the direction arrow included in the marker "top bar" is based on the compass heading, not the more accurate GPS heading.

Example:

osmand_marker_issue_1_small

As you can see, the marker is almost directly east from the current location, but the marker arrow points south west.

Several other apps like GPS Status display the GPS heading when travelling above a certain speed (usually 4 or 5 km/h):

gps_status_small

This issue could be related to #3005 but there's not much detail there for me to be sure. Also, that issue talks about extrapolating position, rather than direction/heading.

Steps to reproduce:

  1. Create a new, active marker.
  2. While moving (either real or simulation), observe the direction arrow in the marker's "top bar".
  3. Rotate the phone. The arrow changes direction, proving that compass heading (rather than GPS) is being used.
vshcherb commented 8 years ago

GPS heading points to your direction basically (bearing), we display marker based on your phone orientation. This is not the same, phone could be directed backwards to your movement direction.

njohnston commented 8 years ago

Could there be an option for this? In almost all cases I'd prefer to use the GPS heading when available.

Assuming you're using the compass / magnetic field sensor to determine phone orientation, this is very susceptible to interference (just try it next to some metal like a railing). I'm not sure how accurate the other sensors (like gyroscope and rotation vector) are.

In the example I showed, I was sitting in a car with my phone facing the direction of movement, so something is still clearly wrong.

sonora commented 8 years ago

As I understand it, the original issue is about where we derive the direction data from, not what/how we display. @njohnston : But please understand, that there is also a misunderstanding on your side saying "the marker arrow points south west": It intends to point in the true (real world) direction of the location in question, and that depends on how you hold your device!

Regarding the issue: I think there must be no extra setting: Motion-derived north detection is much more reliable than compass-derived north detection once you exceed a small minimum velocity, so yes, we could have an automated cut-over between the 2, falling back to compass/magnetic/orientation sensor derived north only when essentially stationary.

vshcherb commented 8 years ago

True we are using gps head direction for Relative Bearing (more "professional" widget), actually it also works with markers and could be used for this use case as well.

sonora commented 8 years ago

We could make it a general adjustment to all direction detection methods we use (or consolidate to one common method anyway), but this sounds like nothing we still want to tackle before the 2.5 release...

njohnston commented 8 years ago

@sonora: thanks for clarifying. I think the feature will be really useful (and much more accurate) when GPS heading is used :)