OpenTracksApp / OpenTracks

OpenTracks is a sport tracking application that completely respects your privacy.
https://OpenTracksApp.com
Apache License 2.0
1.05k stars 189 forks source link

Sensor data not recorded if GPS enabled but speed is zero #1966

Open as123rgb opened 3 months ago

as123rgb commented 3 months ago

Related to #1088. When I stop moving for a few minutes (with GPS on) I see suspicious linear interpolation for every metric:

Red is HR, blue is speed, green is elevation.

If the phone is not moving then dropping redundant GPS coords makes sense, but HR data is still useful and it should be recorded. The speed should probably be recorded as being 0 at the start and end of each interval to avoid weird interpolation, then it would correctly show as 0 over the whole interval and if other applications want to interpolate the data it'll be unambiguously 0.

Here is a snippet of exported kml. No data exists for the intervals where I've stopped moving.

<when>2024-07-18T15:55:31.136+00:00</when>
<coord>xxx.xxxx23 xx.xxxx27 9.313198332140</coord>

<when>2024-07-18T15:55:32.14+00:00</when>
<coord>xxx.xxxx18 xx.xxxx38 8.9174764139130</coord>

<when>2024-07-18T15:55:33.139+00:00</when>
<coord>xxx.xxxx09 xx.xxxx45 8.2689896704566</coord>

<!-- gap of 29.952 seconds -->

<when>2024-07-18T15:56:03.091+00:00</when>
<coord>xxx.xxxx05 xx.xxxx48 9.444981316744</coord>

<when>2024-07-18T15:56:03.153+00:00</when>
<coord>xxx.xxxx05 xx.xxxx48 9.444981316744</coord>

<!-- gap of 110.974 seconds -->

<when>2024-07-18T15:57:54.127+00:00</when>
<coord>xxx.xxxx19 xx.xxxx42 8.5567704015492</coord>

<when>2024-07-18T15:57:55.122+00:00</when>
<coord>xxx.xxxx21 xx.xxxx51 8.6911931082478</coord>
My settings: Setting Value
Recording > Recording distance interval 1 m
Recording > Idle threshold 30 s
Recording > Max distance 200 m
Sensors > GPS > Sampling time interval 0 s
Sensors > GPS > GPS accuracy 20 m

Checklist

Technical information

dennisguse commented 1 month ago

Relevant code is in TrackRecordingManager.onNewTrackPoint(). IIRC this functionality was implemented a while ago - however, it might be broken...