espruino / BangleApps

Bangle.js App Loader (and Apps)
https://banglejs.com/apps
MIT License
492 stars 1.15k forks source link

[run] displayed distance too long compared to rec's track #1910

Open bernhardreiter opened 2 years ago

bernhardreiter commented 2 years ago

Affected hardware version

Bangle 2

Your firmware version

2v13

The bug

The distance of the displayed during operating "run" is significantly longer than the distance which is shown when displaying the track in rec or with an external application.

Expected is that the displayed distance is the same. (Except for minimal rounding and floating point representation differences.)

How to reproduce

Additional info

A similar defect was there with the old banglerun implementation: #761.

First technical ideas:

gfwilliams commented 2 years ago

I think this has been discussed a lot in the forum previously, but what happens if you set your recorder recording interval to 1 second and then record a track and compare distances.

By default the recorder does record an average position over 10 seconds (so 10 GPS intervals) so you'd expect there to be slightly less movement, and what you're seeing (19.6 vs 20.3) is the kind of difference I'd expect. If you disable that I bet you'll find you get the same value reported for each.

So in a way what the run app reports is the more accurate distance based on GPS data.

bernhardreiter commented 2 years ago

I think this has been discussed a lot in the forum previously

(Sorry I must have missed it then.)

if you set your recorder recording interval to 1 second and then record a track and compare distances. [..] I bet you'll find you get the same value reported for each.

I'll try that.

Even then it is a usability problem, as it is not directly visible or explainable from the application. Especially the difference when downloading the track and comparing it with the display.

So why not set the recorder to 1 second also, when used from run?

in a way what the run app reports is the more accurate distance based on GPS data.

I am not sure yet, as my positions "jumps" around a lot, which may introduce more distance (which was not run) again. Guess it mus be compared to real measurements on a map or with a more precise GPS device.

Thanks for responding!

gfwilliams commented 2 years ago

So why not set the recorder to 1 second also, when used from run?

Because then you end up with massive GPS logs. They take up a bunch of space, take a long time to download, and take longer to view stats on or plot on the watch.

You can do it, but it makes no sense as a 'default'

I am not sure yet, as my positions "jumps" around a lot

Yes, this is the problem. My point was that the distance you see is the 'unfiltered' one coming straight from the GPS.

The original 'banglerun' app had a Kalman filter, but it broke quite early on and had to be removed. If I could get a nice clean implementation that worked, I'd love to get something added inside the Bangle.js firmware (or at the very least, the exstats lib) and then we could get some better filtered distances.

However even after that, the distances from the Run App will still differ from the recorded GPS log so I'm not sure there's actually any way to fix this 'bug'.

bernhardreiter commented 2 years ago

Okay, understood that a default of measuring the position each second is producing too big GPS logs.

As least my banglejs2's GPS is less precise than the one of the Banglejs1 and making jumps in the data a problem. So now I understand what the Kalman filter was used for. (It can also we used to predict future points which is less useful in this case, you want it to remove the jitter by many less precise measurements.)

My suggestion to deal with the difference is: a) first use the filter to produce "better" measurements b) safe that new points c) use the same calculation of the distance over the linestring for the run and the recorder display.

Then the calculation of the external map viewer, the internal one of recorder and the run display will be the same. I guess this is what users would find most intuitive.

gfwilliams commented 2 years ago

b) safe that new points

I really don't agree with this. Once you save only your filtered data, there is no way to get it back. If I'm logging GPS data I'd expect to be logging the GPS data, not some filtered version of it. I'd be pretty sure good GPS track readers already have ways to apply good filters to the data anyway.

But my point is:

bernhardreiter commented 2 years ago

Once you save only your filtered data, there is no way to get it back.

Thought about the challenges for a bit, especially from the side of user experience.

My guess is that user do expect that the distance they see in the running app, the GPS part and external map aware apps is the same and the best accuracy they can get from the combination device/software suitable for the purpose (running). So this should be the default as it will have least irritations. (Personally I recommend using more space and battery for this, if necessary. I'd rater have space for 3 "good" tracks than for 10 but with the irritations.)

Looking at the raw data, apply your own filters or optimisations is something I'd expect a smaller group is wanting. So it should be possible, but not default. Maybe a difference between "raw" and normal data can be made. Which is a known concept in other domains (like photography).

Some ideas to improve the situation:

gfwilliams commented 2 years ago

I'd be really interested to hear everyone else's point of view here?

I'm very conscious it's just us two, and that might well not be very representative.

Just to add, if you care about this, it's an easy fix - just set your record period to 1s in record settings, and accept the memory usage that comes with it in order to have the most accurate data

Maybe the best solution here that inconveniences the least people is just to document that.

Darin755 commented 2 years ago

I honestly think that having a simple filter would be a good idea.

gfwilliams commented 2 years ago

You think a filter that applies even to the recorded GPS data?

I can understand filtering the distance value, but then if you want the two values shown to be exactly the same, we'll have to modify the GPS coordinates we write

Darin755 commented 2 years ago

I honestly think that would be acceptable as long as the filter was very unaggressive.