Speed-source arbitration and GPS quality reporting #19
Labels
No labels
area:companion
area:docs
area:shared
area:tooling
area:watchapp
blocker
kind:chore
kind:feature
kind:spike
kind:test
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Depends on
#18 BLE CSC wheel sensor client and wheel-circumference calibration
robert/PedalPebble
#17 Speed pipeline: smoothing, stop clamping, distance, moving average
robert/PedalPebble
Reference
robert/PedalPebble#19
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Pick the best available speed source and tell the watch which one is live.
Acceptance criteria
SPEED_SOURCEsent to the watch: 0 none, 1 GPS, 2 wheel sensorGPS_QUALITYderived from fix accuracy and age, 0-3Files
companion/.../location/SpeedSourceArbiter.ktClosed by PR #102 (merged): resolved the 3s-vs-5s wheel-live-window discrepancy properly \u2014 traced back to D4's original 3s wording, which #69 quietly diverged from with an unreasoned 5s default; corrected to 3s, amended D35 transparently rather than silently. SPEED_SOURCE/GPS_QUALITY wire keys already existed from #7 with matching numbering, no reconciliation needed there. New deriveGpsQuality() (accuracy tier vs. age tier, worse-of) and a SpeedReport.Live/NoSignal type so a dead source reports honestly instead of freezing the last value (D44 principle).\n\nReal bug caught and fixed: onGpsFix's accuracy gate ran before the wheel-live check, so a poor-accuracy fix arriving while the wheel was live got rejected outright instead of refreshing the position baseline \u2014 a sustained bad patch (bridge, urban canyon) with a wheel sensor also live left the baseline stale, and the next good fix after the wheel quieted computed distance against it, producing an unbounded spike. Fixed by checking wheel-liveness first; proven with a regression test (~50m expected vs. the ~95m the bug produced).\n\nVerified for real: :companion:core:test (19+6 new tests), :companion:pebble:test (6 new), :companion:assembleDebug \u2014 all green.