alidiepuit / osmtracker-android

Automatically exported from code.google.com/p/osmtracker-android
GNU General Public License v3.0
0 stars 0 forks source link

Add GPS accuracy info in GUI & GPX #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please add GPS accuracy information to the GUI and in the gpx file. 
Location.getAccuracy() divided by 5 or 6 will give an estimated hdop value.

Original issue reported on code.google.com by oledalga...@gmail.com on 26 Mar 2010 at 10:13

GoogleCodeExporter commented 9 years ago
JOSM can use this information nicely: colourising or drawing error circles. 
<fix> and
<sat> would be nice to have too, for comparison with other hardware.

Original comment by a.t.chadwick on 26 Mar 2010 at 11:22

GoogleCodeExporter commented 9 years ago
Thanks for your feedback, I will have a look at that.

@oledalgaard: You seem to know a bit about development, I'm totally open to 
patch
submissions so don't hesitate to submit one if you want.

Original comment by nguillau...@gmail.com on 26 Mar 2010 at 12:14

GoogleCodeExporter commented 9 years ago
I've done a bit of research about GPS accuracy. As far as I understand,
location.getAccuracy() returns an accuracy in meter, which is not the DOP. DOP 
is
unitless, and the Accuracy calculation certainly includes it, but it's 
impossible to
know how (so to reverse the calculation and retrieve DOP seems impossible too).

Another way to get DOP and other info (fix type for example) would be to 
implement
the NmeaListener interface
(http://developer.android.com/reference/android/location/GpsStatus.NmeaListener.
html), however
it's available only on > 2.0 devices and I don't want to lock the app. on such 
high
sdk level (I've an 1.6 device myself ;) ).

Maybe calculating DOP using the Satellite information is possible, but I don't 
have
any clues about that. Found some resources with google but nothing really 
helpful.

Any ideas ?

Original comment by nguillau...@gmail.com on 27 Mar 2010 at 6:48

GoogleCodeExporter commented 9 years ago
Well, you are right nguillaumin, there is no fixed translation between hdop and 
accuracy in meters. It depends on the gps hardware and several other factors. 
http://users.erols.com/dlwilson/gpshdop.htm talks about the issue, but only 
uses 
one gps. 

But what is the needed precision for this? It just decides colors of the dots 
in JOSM. It 
is rare that the accuracy of my HTC Hero gps is below 4-6 meters and a HDOP of 
1 is 
very good. so divide the accuracy with 4 or 6 will give an ok estimate. 

Actually I think that accuracy in meters is a much more understandable measure 
than 
HDOP, sadly gpx does not support it.

Original comment by oledalga...@gmail.com on 27 Mar 2010 at 8:48

GoogleCodeExporter commented 9 years ago
I have started coding a patch - the sqlite and gpx parts are not hard. Any 
ideas on how 
to show the accuracy or number of satellites on the screen?

Original comment by oledalga...@gmail.com on 27 Mar 2010 at 9:56

GoogleCodeExporter commented 9 years ago
Perhaps a small bar graph or set of horizontally stacked 2px blocks ranging 
from 0 to
max(num_sats_visible)?

For the GPX generation, perhaps extending the core of GPX is the way to go for 
fields
that aren't expressible in plain GPX. Here's how mtkbabel (for one of my newer 
GPS
logger units) does it:

 <gpx ...
      xmlns:mtk="http://www.rigacci.org/gpx/MtkExtensions/v1"
      ...>
 ...
 <trkpt lat="52.061814440" lon="-1.330025026">
  <ele>139.707977</ele>
  <time>2010-03-27T14:37:08Z</time>
  <type>TIME</type>
  <fix>3d</fix>
  <sat>9</sat>
  <hdop>0.92</hdop><!-- unit might be lying here -->
  <extensions>
   <mtk:wptExtension>
    <mtk:valid>sps</mtk:valid>
    <mtk:satinview>10</mtk:satinview>
   </mtk:wptExtension>
  </extensions>
 </trkpt>

Which would allow _users_ to hack a non-HDOP value into the HDOP field in order 
to
get some nice editor behaviour if they wanted. I don't think a program 
generating
good, conformant GPX should to that for them though. xmlns:osmt4a, anyone?

Original comment by a.t.chadwick on 27 Mar 2010 at 10:14

GoogleCodeExporter commented 9 years ago
I implemented yesterday accuracy recording in DB, and outputs it in the GPX 
file as a
comment for the moment, as I didn't know what to do with it (Sorry for the 
collision,
oledalgaard).

I think it shouldn't be put in the <hdop> tag, because it's not hdop and I 
don't like
to generate "bad" GPX (Too ethical maybe ?). The extension solution is 
interesting, I
already look at it but I would like to re-use and existing one, instead of 
creating a
new extension. The MTK one is interesting but is tied with MediaTek chips, I 
would
prefer an vendor-free extension.
The drawback is that someone would have to write a patch for JOSM to read this 
data,
but I prefer it this way and keep a "clean" GPX file.

Concerning GUI I think a small bar graph should do it, or maybe a 
cellphone-like bar
graph as the actual OSMTracker for Windows Mobile
(http://wiki.openstreetmap.org/wiki/OSMtracker/Docs#GPS_indicator) ? It could 
come in
replacement of the round led+satellite on top left corner, which I'm sure are
meaningless for most of users ;-)
I was wondering to have a satellite-status screen too, like
http://img.gpsreview.net/wp-content/uploads/garmin-satellite-info.jpg

Original comment by nguillau...@gmail.com on 28 Mar 2010 at 3:52

GoogleCodeExporter commented 9 years ago
It is OK, my implementation looks a lot like yours. The only differences being 
that I 
added number of satellites as well as I added location.hasElevation() and 
location.hasAccuracy(). Just to make sure that the device supports it and that 
there is no 
fake numbers in the gpx file.
I am looking forward to see the gui part added as well. I did not do any work 
there :-)

Original comment by oledalga...@gmail.com on 28 Mar 2010 at 7:09

GoogleCodeExporter commented 9 years ago
Just done it, will be available in next release.

- Added GUI visualization of satellite strength (based simply of number of 
satellites
for the moment, I'm not using signal to noise ratio for example)
- Added display of accuracy in meters
- Added accuracy in GPX file. User can choose whether he wants it or not, and 
if he
wants it in the waypoint name into brackets, or in the <cmt> tag (This way is
probably the more simple and consensual solution for the moment, until DOP
calculations or GPX schema extension is done)
- Added <sat> info in GPX

Original comment by nguillau...@gmail.com on 29 Mar 2010 at 3:00

GoogleCodeExporter commented 9 years ago
Thanks for that, it was fast :-)
I like the GUI part, except that I would remove the accuracy when fix is lost, 
at least 
after a few seconds.
With regard to the gpx file, I would like to have satellite and accuracy info 
in the 
trackpoints as well as the waypoints. It gives a lot of value in JOSM to have 
accuracy 
info, see josm1.png and josm2.png. Without it you just get a grey line like in 
josm3.png. Could you make it optional to get the estimated hdop? Maybe with a 
warning? 
It would give valueable information when editing in JOSM.

Original comment by oledalga...@gmail.com on 29 Mar 2010 at 7:52

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the screenshots, didn't know this interesting feature of JOSM.

I'll open a new issue concerning DOP. I'm reoping this one just not to forget 
to hide
accuracy when signal is lost.

Original comment by nguillau...@gmail.com on 29 Mar 2010 at 8:42

GoogleCodeExporter commented 9 years ago
Just fixed it, will be available in next release.

Original comment by nguillau...@gmail.com on 29 Mar 2010 at 10:21