BRouterEnricher via IBRouterService AIDL #27

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

Goal

The preferred enrichment backend: fully offline, free, no account, no terms-of-service concerns.

Acceptance criteria

  • IBRouterService bound, with a clear message when BRouter is not installed and a link to install it
  • Route points passed as lonlats with a bike profile and turnInstructionMode set
  • Returned GPX parsed and voice hints (TL, TR, KR, ...) mapped to the canonical enum
  • Street names extracted where present
  • Missing segment files detected and reported as a recoverable failure so the chain falls through
  • Enrichment runs off the main thread with progress shown

Files

  • companion/.../route/enrich/BRouterEnricher.kt

Notes

Depends on Spike C. OsmAnd's BRouter adapter is a working reference.

Update — 2026-09-01: the divergence check is mandatory

BRouter is a router, not a map-matcher: given via points it computes its own route under its own
profile, which can differ from the imported line, and a cue sheet describing a route the rider is not
on is the worst failure this app has (D25).

  • Geometric divergence between BRouter's returned line and the source GPX computed on every
    enrichment
    , and the result rejected above 20 m — falling through to the next tier rather
    than being shown
  • Divergence value stored with the cue sheet, and shown in the cue-sheet review (#55)
  • Via-point decimation follows the curve measured in #6, not a guess
  • maxRunningTime / timeout handled as a real outcome: fall through to the next tier, never a
    partial cue sheet
  • If #6 finds BRouter's reference-track mode reachable over AIDL, use it instead — this issue
    changes shape and the via-point path becomes the fallback
  • Availability and segment coverage handled by #64, not re-implemented here

Update — 2026-09-02: reject per leg, not per route

  • The 20 m divergence check runs per leg, between consecutive via points
  • Legs within threshold keep their cues; legs beyond it have their cues dropped and the stretch
    marked unenriched
  • Wholesale rejection only when the failing-leg fraction exceeds the bound established by #6
  • NAV_CUE_CONFIDENCE already travels per cue, so no new plumbing is needed — only the check's
    granularity was wrong

One bad 50 m stretch must not discard a 100 km cue sheet (D41, NFR-P8).

## Goal The preferred enrichment backend: fully offline, free, no account, no terms-of-service concerns. ## Acceptance criteria - [ ] `IBRouterService` bound, with a clear message when BRouter is not installed and a link to install it - [ ] Route points passed as `lonlats` with a bike profile and `turnInstructionMode` set - [ ] Returned GPX parsed and voice hints (`TL`, `TR`, `KR`, ...) mapped to the canonical enum - [ ] Street names extracted where present - [ ] Missing segment files detected and reported as a recoverable failure so the chain falls through - [ ] Enrichment runs off the main thread with progress shown ## Files - `companion/.../route/enrich/BRouterEnricher.kt` ## Notes Depends on Spike C. OsmAnd's BRouter adapter is a working reference. ## Update — 2026-09-01: the divergence check is mandatory BRouter is a router, not a map-matcher: given via points it computes its own route under its own profile, which can differ from the imported line, and a cue sheet describing a route the rider is not on is the worst failure this app has (D25). - [ ] **Geometric divergence between BRouter's returned line and the source GPX computed on every enrichment**, and the result **rejected above 20 m** — falling through to the next tier rather than being shown - [ ] Divergence value stored with the cue sheet, and shown in the cue-sheet review (#55) - [ ] Via-point decimation follows the curve measured in #6, not a guess - [ ] `maxRunningTime` / timeout handled as a real outcome: fall through to the next tier, never a partial cue sheet - [ ] If #6 finds BRouter's reference-track mode reachable over AIDL, **use it instead** — this issue changes shape and the via-point path becomes the fallback - [ ] Availability and segment coverage handled by #64, not re-implemented here ## Update — 2026-09-02: reject per leg, not per route - [ ] The 20 m divergence check runs **per leg**, between consecutive via points - [ ] Legs within threshold keep their cues; legs beyond it have their cues dropped and the stretch marked unenriched - [ ] Wholesale rejection only when the failing-leg fraction exceeds the bound established by #6 - [ ] `NAV_CUE_CONFIDENCE` already travels per cue, so no new plumbing is needed — only the check's granularity was wrong One bad 50 m stretch must not discard a 100 km cue sheet (D41, NFR-P8).
Sign in to join this conversation.
No description provided.