Skip to content

Turn instructions from Organic Maps' turn generator; junction lab - #42

Merged
Monstrofil merged 13 commits into
mainfrom
organic-turns-v2
Oct 28, 2026
Merged

Monstrofil merged 13 commits into
mainfrom
organic-turns-v2

Conversation

@Monstrofil

Copy link
Copy Markdown
Contributor

OsmAnd still routes; Organic Maps' car turn generator (vendored in third_party/organicmaps-routing, Apache-2.0, upstream 303ef27) decides the manoeuvres on OsmAnd's route for voice, screen and cluster.

  • backends/osmand/omaps_turns.cpp: OsmAnd route + every road at each node → OM's IRoutingResult → ui::Maneuver (kinds, turn:lanes only, cluster junction shape). Roundabouts stay OsmAnd's.
  • No silent fallback: OsmAnd's manoeuvres only with the osmand-turns marker; an OM failure gives a route without turns and worker=omaps_error (AGENTS.md).
  • OSM data fixes in the adapter: overlapping ways collapse to one edge per next point; route points under 2 m apart are one junction.
  • OM fixes: a wide U-turn skipped the next turn; OM's tie-break "slight" between two near-straight roads is keep left/right.
  • Junction lab (tools/junction_lab): host OsmAnd router + the backend's own code, map page, cases.tsv regression check.
  • Deploy: deploy/navigation-ifs/deploy_backend.sh; build/deploy skills describe the vp4r slot layout.

Checks: host tests 35/35, QNX make/make ifs with all ELF checks, junction_lab.py --check tools/junction_lab/cases.tsv 5/5. OM costs 2–3 ms per route on the PC.

🤖 Generated with Claude Code

Monstrofil and others added 13 commits October 28, 2026 15:27
Routes FROM -> TO with OsmAnd's router built for the host
(tools/junction_lab/host_osmand: core-legacy routing, protobuf, expat;
logging and one Skia rect function stubbed) and shows each manoeuvre's
cluster symbol on a map page, computed by the backend's own code.

The worker's segment -> manoeuvre code (maneuver_kind, lanes_of,
junction_of) moves unchanged to route_maneuvers.cpp, with maneuver_at()
for one segment, so the radio and the lab share it. junction_probe runs
the classifier alone on edited angles.

  tools/junction_lab/build.sh
  python3 tools/junction_lab/junction_lab.py   # http://localhost:8765

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dumps all roads at each node

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…:lanes or are invented

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y place

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vendored from organicmaps 303ef27 (Apache-2.0, tools/junction_lab/omaps;
the README lists every edit: C++17 and dependency shims only, the turn and
lane decisions unchanged). omaps_adapter feeds it OsmAnd's route and all
roads at each node; junction_lab_tool prints its turns as omaps next to
OsmAnd's manoeuvres.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CheckUTurnOnRoute returned i + 1 turns to skip for a U-turn found i
segments ahead, which also dropped the first turn after it (the exit right
at 48.488918,34.938895). Returns i, the turns inside the U-turn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ime per route

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OsmAnd still routes; Organic Maps' car turn generator (vendored in
third_party/organicmaps-routing, Apache-2.0, upstream 303ef27) now decides the
manoeuvres on OsmAnd's route: backends/osmand/omaps_turns.cpp feeds it the
route and every road at each node from the routing context and maps its
directions and turn:lanes to ui::Maneuver. It measures a turn over the road's
curve, announces links leaving the road and drops a road that only
continues; no more invented lanes. Roundabouts stay OsmAnd's (exit and angle).

- The worker annotates each found route while its routing context is
  alive; convert() places manoeuvres at their route point, also mid-segment.
- The cluster junction shape comes from OM's route angle and other roads.
- OsmAnd's own manoeuvres only with the osmand-turns marker
  (OPEN_NAVICORE_OSMAND_TURNS=1); when OM fails on a route there is no
  fallback: the route has no turns and worker=omaps_error is traced
  (AGENTS.md: obvious failures, not silent fallbacks).
- OSM data OM's maps never have: overlapping ways at a node collapse to one
  (OsmAnd's attachSegments rule, for every road), route points under 2 m
  apart are one junction (a 0.3 m stub gave a left-then-right).
- OM fix: a wide U-turn skipped the turn after it (CheckUTurnOnRoute).
- Junction lab: the radio's code path, cluster symbols per manoeuvre,
  tools/junction_lab/cases.tsv with junction_lab.py --check; paths from
  OSMAND_QNX_ROOT / OPEN_NAVICORE_MAPS instead of workstation paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A catch of std::exception put a relocation against libstdc++'s typeinfo into
the read-only .ARM.extab; the plugin's -z text link rejected it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The radio boots slots/<slot>/ifs/50-navicore.ifs (provider, ~0.8 MB) and links
the backend, OsmAnd core and bundle from slots/<slot>/data/navicore at boot
(since 2026-10-24); the skills still described one 100 MiB navigation.ifs in
/datastore/navicore with no backend-only install. deploy_backend.sh installs
the backend into the booted slot: staged upload, sha256 on the unit, rename
swap keeping the previous file, flush.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Where OM's own angle says go straight (under 10 degrees) and it reports a
slight turn only because the route is the leftmost/rightmost of two almost
straight roads (CorrectRightmostAndLeftmost / CorrectGoStraight), the driver
gets keep left/right: voice 'keep left', cluster fork picture. At
48.410077,35.086365 the road bears right and a ramp tagged primary leaves 9
degrees further right; OM said turn slightly left.

Lab: cases.tsv tokens may pin the kind (Direction/kind); road dump shows
each road's ends; OsmAnd roundabouts named OsmAnd:RNDB<n>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Monstrofil
Monstrofil merged commit 6103395 into main Oct 28, 2026
1 check passed
@Monstrofil
Monstrofil deleted the organic-turns-v2 branch October 28, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant