[SailfishDevel] Measuring distance with GPS
Martin Kolman
martin.kolman at gmail.com
Tue Jul 8 20:14:22 UTC 2014
8.7.2014 21:32, Caliste Damien:
> Hello,
>
> Le lundi 07 juillet 2014, Timur Kristóf a écrit :
>> I'd like to ask a simple question: what is the simplest way to make a
>> Sailfish app that measures the distance the user has walked.
> Answers have been already given on how to do this in C++ or in QML. I
> just would like to add some remarks :
> - if you sum up the distance between GPS fix at regular intervals (some
> seconds), you may end up with a total distance that is greater than the
> actual distance, especially because of some portions of your path that
> are not very accurate and put you away from your actual path (think
> about passing under a bridge, or your GPS is in your pocket, or you are
> close to the start of the GPS fix so the accuracy is still low…)
> - I don't know how Modrana is doing this, but I decided to keep for
> actual distance measurements, only fixes with a reasonable
> horizontal accuracy (e.g. lower that 30 meters), in my application (cf.
> Maep-qt on github)
ModRana actually doesn't do anything fancy - every time a position update
comes in, it computes the distance from the last point and adds the
distance to
the total. Only "filtering" it does is on what it appends to the
tracklog - modRana
only appends points that are more than a given threshold distant from
the last point.
This is done to skip recording of needless points when the user is not
moving but
has not paused the logging. I guess it might not be a bad idea to apply
the same metric
also to the cumulative distance.
Also regarding the accuracy data values the Jolla reports - horizontal
and vertical
accuracy are always the same. Unfortunately this seems to be a hardware
limitation, not a bug. [0]
And from my testing the altitude-valid field switches on/off every other
second.
While these observations are probably not that important for normal
mostly 2D usage,
it might be good to take them into account when using the GPS data in 3D
(route profiles, 3D distance, airplanes).
> - It's quite interesting to save a series of fixes at 1 second interval
> for instance from start of GPS to end of 30 minutes walking in
> different conditions. When plotting h_acc(t), you can see that it's
> improving by plateau and when the signal is correct (typically after
> some minutes) the h_acc is below 30m for most of the fixes. Then, plot
> deltaD(t) and h_acc(t) together (deltaD being the distance walked in 1
> second), you'll see that for high h_acc values the deltaD values are
> quite spurious for a walking person and thus should be ignored.
Interesting! :)
> Thus, I would suggest to calculate the total distance by summing up
> distances between fixes with a lower enough horizontal accuracy.
>
> Regards,
>
> Damien.
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org
More information about the Devel
mailing list