Off-route detection with hysteresis and auto-recovery #32

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

Goal

Detect leaving the route without crying wolf every time GPS wobbles under trees.

Acceptance criteria

  • Off-route declared beyond roughly 40 m sustained for roughly 10 s
  • Different enter and exit thresholds, so the state does not oscillate at the boundary
  • NAV_STATE sent to the watch on every transition
  • Automatic recovery when the rider rejoins anywhere on the route, including further along
  • Distinct watch vibration for going off route
  • No re-routing in v1 - report the state and let the rider decide

Files

  • companion/.../route/nav/OffRouteDetector.kt

Update — 2026-09-02: emit the rejoin bearing

Off-route now produces guidance, not just a state (D42, FR-N7a).

  • While NAV_STATE = 2, emit NAV_REJOIN_BEARING (degrees relative to the rider's heading)
    and NAV_REJOIN_M
  • Both cleared when the rider rejoins; the original cue sheet resumes on its original distance
    axis, untouched
  • Rejoin-point selection is #57's; this issue consumes it
  • Hysteresis behaviour is unchanged
## Goal Detect leaving the route without crying wolf every time GPS wobbles under trees. ## Acceptance criteria - [ ] Off-route declared beyond roughly 40 m sustained for roughly 10 s - [ ] Different enter and exit thresholds, so the state does not oscillate at the boundary - [ ] `NAV_STATE` sent to the watch on every transition - [ ] Automatic recovery when the rider rejoins anywhere on the route, including further along - [ ] Distinct watch vibration for going off route - [ ] No re-routing in v1 - report the state and let the rider decide ## Files - `companion/.../route/nav/OffRouteDetector.kt` ## Update — 2026-09-02: emit the rejoin bearing Off-route now produces guidance, not just a state (D42, FR-N7a). - [ ] While `NAV_STATE = 2`, emit `NAV_REJOIN_BEARING` (degrees **relative to the rider's heading**) and `NAV_REJOIN_M` - [ ] Both cleared when the rider rejoins; the original cue sheet resumes on its original distance axis, untouched - [ ] Rejoin-point selection is #57's; this issue consumes it - [ ] Hysteresis behaviour is unchanged
Sign in to join this conversation.
No description provided.