Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Replace 15s interval, 15m threshold with statistical formula. #97

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

voussoir
Copy link
Contributor

@voussoir voussoir commented Mar 12, 2021

Will close #96.

Yesterday I took a long walk with this changed version of Trackbook and was happy with the results. The points were recorded about twice as frequently as normal without decreasing the track quality or rest detection.

Note!! In the future, I think we should modify isAccurateEnough to increase the confidence that we are below the user's set threshold. Like this:

         when (location.provider) {
-            LocationManager.GPS_PROVIDER -> isAccurate = location.accuracy < locationAccuracyThreshold
+            LocationManager.GPS_PROVIDER -> isAccurate = (location.accuracy * 2) < locationAccuracyThreshold
             else -> isAccurate = location.accuracy < locationAccuracyThreshold + 10 // a bit more relaxed when location comes from network provider
         }

However, I did not do that in this pull request because any user who has already tuned their accuracy threshold setting will suddenly find that their tracks are recording fewer points after updating. Increasing confidence decreases tracking interval. I don't want to make that change without further careful consideration. Likewise, we can do accuracyDelta * 2 (or even just 1.5, etc.) if we want to increase the confidence in distance deltas.

One more note: If we're going to keep the waypoint interval at 1s, perhaps we should merge that function with MapFragment.kt's periodicLocationRequestRunnable which also runs at 1s. At the moment, this pull request keeps them as separate timers, which is probably a bit wasteful.

Thank you @y20k and @Hob111.

These changes increase the rate at which points are recorded to
the track without decreasing track quality. Users with fine-grained
GPS units should see much more accurate tracks.
@y20k y20k merged commit 69828ee into y20k:master Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: configurable update frequency, not fixed to 15s
2 participants