Bugfix: TrackStatisticsUpdater was computing distance incorrectly.

While using a cycling speed and distance sensor, the updater was not using the distance from the most recent trackpoint but rather the one considered last moving.

Fixes #762.
This commit is contained in:
Dennis Guse
2021-05-13 08:00:42 +02:00
parent d7f339c6f8
commit 00489a121a
3 changed files with 63 additions and 1 deletions
@@ -159,7 +159,7 @@ public class TrackStatisticsUpdater {
if (!trackPoint.hasSensorDistance()) {
// GPS-based distance/speed
Distance movingDistance = lastMovingTrackPoint.distanceToPrevious(trackPoint);
Distance movingDistance = trackPoint.distanceToPrevious(lastMovingTrackPoint);
if (movingDistance.lessThan(minGPSDistance) && !trackPoint.isMoving()) {
speedBuffer_mps.reset();
lastTrackPoint = trackPoint;