Skip to content

Facing regular spikes on distance calculation #2659

Description

@diveshnailwal

We're seeing odometer distance spikes on Android in production.

Actual routes of ~100–200 km are reporting odometer values in the thousands of km — one journey reported 9,397 km on a ~195 km drive. Attached are the map views of the recorded routes; the GPS trail itself is correct, only the odometer is wrong.

Looking at consecutive onLocation events, the odometer jumps forward by 5+ km thousands of times and goes negative an almost equal number of times, so it seems to oscillate rather than drift. Affected devices are realme RMX5250, realme RMX3842, samsung SM-M127G, iQOO I2126 and OnePlus CPH2793 (Android 13–16) — all manufacturers with aggressive background process management.

Our config:

{
reset: true,
geolocation: {
desiredAccuracy: DesiredAccuracy.High,
distanceFilter: 10,
stopTimeout: 1,
stationaryRadius: 15,
filter: {
policy: LocationFilterPolicy.Conservative,
useKalman: true,
kalmanProfile: KalmanProfile.Conservative,
trackingAccuracyThreshold: 50,
odometerAccuracyThreshold: 40,
maxImpliedSpeed: 40,
},
},
persistence: { persistMode: PersistMode.Location },
app: {
stopOnTerminate: false,
startOnBoot: true,
enableHeadless: true,
},
http: {
autoSync: true,
batchSync: true,
maxBatchSize: 50,
},
}
Start sequence is start() → changePace(true) → resetOdometer().

Can you help identify what would cause this? Happy to share raw event logs.

Image Image Image Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions