Speed pipeline: smoothing, stop clamping, distance, moving average #17

Open
opened 2026-08-31 17:14:40 +02:00 by robert · 0 comments
robert commented 2026-08-31 17:14:40 +02:00 (Migrated from git.butzei.de)

Goal

Turn raw fixes into numbers that look right on the handlebars.

Acceptance criteria

  • FusedLocationProviderClient at 1 s, high accuracy
  • Location.getSpeed() used where available, distance/dt as fallback
  • Speed smoothed over roughly 3 s
  • Speed clamped to zero below about 0.8 m/s so the display does not drift at traffic lights
  • Cumulative distance accumulated with an accuracy gate to reject bad fixes
  • Moving average excludes stopped time
  • Fixes with poor accuracy rejected rather than folded into distance

Files

  • companion/.../location/SpeedPipeline.kt

Update — 2026-09-01: "stopped" is defined in #69, not here

Moving time and the moving average both need stop detection, and FR-M8 (auto-pause) sat two phases
away in Phase 5 as "behaviour not yet specified". Two phases apart, that becomes two definitions of
stopped and rides where the average speed and the ride timer disagree.

  • Consume the shared StopDetector from #69 rather than defining stopped locally
  • State explicitly whether the 0.8 m/s display clamp and the stop threshold are the same number,
    and why

See D35.

## Goal Turn raw fixes into numbers that look right on the handlebars. ## Acceptance criteria - [ ] `FusedLocationProviderClient` at 1 s, high accuracy - [ ] `Location.getSpeed()` used where available, distance/dt as fallback - [ ] Speed smoothed over roughly 3 s - [ ] Speed clamped to zero below about 0.8 m/s so the display does not drift at traffic lights - [ ] Cumulative distance accumulated with an accuracy gate to reject bad fixes - [ ] Moving average excludes stopped time - [ ] Fixes with poor accuracy rejected rather than folded into distance ## Files - `companion/.../location/SpeedPipeline.kt` ## Update — 2026-09-01: "stopped" is defined in #69, not here Moving time and the moving average both need stop detection, and FR-M8 (auto-pause) sat two phases away in Phase 5 as "behaviour not yet specified". Two phases apart, that becomes two definitions of stopped and rides where the average speed and the ride timer disagree. - [ ] Consume the shared `StopDetector` from #69 rather than defining stopped locally - [ ] State explicitly whether the 0.8 m/s display clamp and the stop threshold are the same number, and why See D35.
Sign in to join this conversation.
No description provided.