12 Commits

Author SHA1 Message Date
94475098a2 feat(lane_route_core): follow preferred lanes, fail fast on blocked goals, allow_unknown (R2.14)
- Start and goal attach to the middle of nearby edges: query-time split points
  (projection and +-1.5 m) on up to 6 directed edges within 3 m, plus up to 4
  preferred edges within 8 m. The compiled graph is unchanged; retries block the
  parent edge.
- Preferred lanes join each other and split nodes; lane ends are protected from
  swing merging, and turns next to a preferred ridge are not penalised. Hard
  rules (forward only, radius, 30 mm gap) are unchanged.
- Goal footprint on a lethal cell returns goal_in_obstacle before any search;
  on unknown it returns goal_in_unknown unless allow_unknown.
- allow_unknown (default false): when true every planner check treats unknown
  as free. The reference graph from robot_costmap_2d still skips unknown.

SEHC replay: lane metres m4 0.3 -> 13.3, m7 1.1 -> 13.8, m8 0.4 -> 26.4.
Random near-lane 190/200 both; NVC 316/316; regress7 3418 (4 losses all solve
when run alone); m15 31.0 m 8/8; independent recheck 0 violations. 146 tests.
2026-11-20 16:30:47 +07:00
6367f13d7d feat(lane_route_core): try the lattice when a verified graph route is a suspicious detour
When the graph tier returns a verified path longer than
suspicious_ratio * chord + suspicious_margin_m, and the lattice tier is
enabled, run one lattice attempt within its own time budget and the request
deadline. The lattice path replaces the graph path only if it is verified, not
cancelled, and its cost (length plus zone_deviation_weight * deviation / 45)
is at least detour_upgrade_min_saving lower, without adding more than
detour_upgrade_max_extra_zone_deviation_m of zone-deviated length.

- PlannerConfig: detour_upgrade_enabled (true), detour_upgrade_time_limit_s
  [s] (2.0), detour_upgrade_min_saving (0.15, in [0, 1)),
  detour_upgrade_max_extra_zone_deviation_m [m] (0.5); validated in
  PlannerConfig::validate().
- PlanInfo: detour_upgrade_outcome (off, not_triggered, taken, kept_graph,
  kept_graph_zone_deviation, lattice_failed, cancelled), graph/lattice length,
  cost, zone deviation, time and lattice reason.
- lane_route_eval: overrides for the new keys, outcome fields in the JSON.
- Tests: lane_route_core_test 135/135.
2026-11-16 14:01:11 +07:00
4cb395f525 feat(lane_route_core): zone deviation cost and graph/lattice completeness fixes (R2.12)
- Graph tier: add zone_deviation_cost (weight * ds * dev_deg/45) to compiled,
  query and shortcut edges, so aligned travel is preferred and a diagonal is
  only used where a straight move is not possible.
- Drop the route_too_long rejection; its relaxed standability reference
  ignored heading continuity and discarded verified long routes.
- Graph retries: skip duplicate candidates and block the edge pair nearest
  the verifier failure location.
- Lattice: heading-sector guide field, zone-transition retry, finer-bin
  refinement before reporting lattice_approx_exhausted, analytic connector
  best-cost choice. The lattice plans with zone_deviation_weight 0.
- lane_route_eval: zone_deviation_weight and time_limit_s keys,
  zone_dev_len_m / zone_dev_integral output.

Sim config: random 300 scenes hook 224 vs 212, kit 199 vs 196; regress7
3416 = R2.11 baseline; independent recheck 0 violations; 128 tests pass.
2026-11-11 14:31:32 +07:00
447ce46c29 feat(lane_route): footprint-zone rule with entry/exit transition, longer lane-end links (R2.11)
- A footprint may overlap a direction zone against its heading only within
  zone_transition_m (default 1.0 m) of path where the centre is inside that
  same zone, or at a parked endpoint. Checked on whole paths by the verifier.
- The lattice C-space keeps the strict per-pose rule so its paths always pass.
- Lane-end junction links reach 8 m with up to 24 links (was 6 m / 12 tries).
- lane_route_eval can dump the graph, attempts and routes per query.
2026-11-10 16:32:02 +07:00
a4b655b74b feat(lane_route): second heuristic field and diagonal zone margin (R2.10)
- lattice_alt_field_enabled (default false), lattice_alt_field_relax_m,
  lattice_alt_field_switch_fraction: when the search on the first field
  has not finished at the switch point, it restarts once on a field with
  no extra clearance and the alternate relax. Exhausted searches do not
  switch. PlanInfo/eval/debug line report field_pass.
- lattice_field_zone_margin_deg (default 0): diagonal field steps through
  a direction zone must stay that far inside the deviation limit; at
  exactly 45 deg the field otherwise follows a diagonal a turning robot
  cannot hold (sim M4, M7, 4a timed out even with 10 s).
- lane_route_eval compiles the graph with the live master when it holds
  preferred cells, as the plugin does.
- Measured 10/11 (sim settings, 10 s, margin 15, alternate on): regress7
  hook_150 1719, kit 1718, no query lost, independent recheck 0 bad.
2026-11-10 13:42:23 +07:00
1d26e29899 feat(lane_route): heuristic-only standability relax for the lattice field (R2.9)
- lattice_field_standability_relax_m (default 0): shrinks the inflated
  footprint half sizes for the lattice heuristic field only; graph
  reference, C-space and verification stay strict.
- Plugin loads it, prints it on the fallback boot line; README and eval
  override key.
- Measured 10/11: with extra field clearance 0 any relax reopens the sim
  post gaps (dumps 1, 2, 4 time out); with extra clearance 0.1 a relax of
  0.035 keeps them and gains one kit query.
2026-11-10 10:36:02 +07:00
4453f454a9 feat(lane_route): footprint standability, unknown cells in graph gap (R2.8)
- Standability: a cell is passable for the graph length reference and the
  lattice heuristic field only when the footprint plus the minimum gap fits
  at one of 16 headings; memoised per 32x32 tile, open space skips the test.
- Graph reference no longer cuts diagonal corners; route_too_long reports
  the reference length.
- Lattice field: coarse block passability decided lazily on first touch.
- ReferenceMemo: one route_too_long reference search per core pass instead
  of one per candidate.
- Graph tier counts unknown cells as obstacles for the footprint gap, like
  the lattice (user ruling 10/11).
- PlanInfo and eval JSON: standability counters, graph reference length.
2026-11-10 10:01:39 +07:00
527071827f feat(lane_route): sharp corners as the last radius rung, heuristic field margin (R2.7)
max_kink_deg (default 45): in the graph's second pass, a corner where no
radius fits may become a sharp corner (two straight lines meeting at one
vertex pose, no turn in place) when the footprint can rotate at the
vertex; the verifier counts it in PathCheck::corners. The verifier's
bend limit now follows min_turn_radius_m (it blocked radii below ~0.72 m).

lattice_field_extra_clearance_m (default 0): extra clearance for a cell
to be passable in the lattice heuristic field only, with a rebuild of
the plain field when the margin field never reaches the start.

regress7 with the sim settings (0.4 m floor, margin 0.1): hook_150
1717/1757, kit 1716/1757 (R2.5: 1718, 1709); Python recheck finds no
curvature, corner, spin, zone or crossing errors. The graph tier's
30 mm gap still ignores unknown cells, as since R0.
2026-11-09 23:30:46 +07:00
907fa0c4dc feat(lane_route): radius ladder and failure dumps (R2.6)
Radius ladder: the first graph pass, the lattice and the smoother use
only radii at or above regular_turn_radius_m (1.06 m), as before. When
min_turn_radius_m is lower, the graph runs a second pass with all
corner_radii_m if the first fails or returns a long detour, and keeps
it only when at least 20% shorter. Optional lattice tight arcs exist
behind lattice_tight_arcs (off: they cost many queries to timeouts).
C++ defaults keep the old 1.06 m floor; regress7 output is identical.
With a 0.4 m floor: graph-only coverage +5 (hook_150) and +8 (kit),
none lost; with fallback, coverage unchanged and 27/29 queries move
from lattice to graph; tight corners used 0.9 m.

Failure dumps: with debug/dump_dir set, the plugin writes each failed
query as lane_route_eval input (static cost, master cost, direction
codes, poses, settings), at most debug/dump_max_files per session.
2026-11-09 20:09:43 +07:00
d27cff23bd feat(lane_route): keep a preferred footprint gap on lattice paths (R2.5)
The lattice tier first finds a path with the minimum gap, as before, so
coverage cannot drop. If that path is not legal under
lattice_preferred_gap_m (0.15 m) away from the ends, a bounded upgrade
search (lattice_preferred_time_fraction of the rung slice) tries a wider
path and replaces it on success. Smoothing keeps the margin of the
returned path. PlanInfo, eval JSON and the plugin debug/fallback line
report the gap pass, the minimum gap and the upgrade time. The plugin
loads the preferred-gap and smoother keys.

regress7 (3 s): coverage equal to R2c (hook_150 1718, kit 1709),
graph-only output identical, middle gap >= 0.15 m on 133/153 and
128/190 lattice paths (R2c 88 and 89), Python recheck 0 bad.
2026-11-09 17:42:48 +07:00
b0a3954541 feat(lane_route): smooth lattice paths (R2) and expose the lattice tier in the plugin (R3)
- lane_route_core: port of the S3 smoother for lattice paths (direct,
  greedy and bounded graph improvement over witness anchors, then
  clothoid corners when budget remains), shape metrics and smoother
  diagnostics in PlanInfo and lane_route_eval.
- lane_route_planner: loads the lattice keys from YAML, logs a config
  summary at start-up and one debug/fallback line per lattice request.

regress7: coverage unchanged from R1, every lattice path smoothed, 0 bad
in the independent recheck. Local snapshot for history only; not pushed.
2026-11-09 16:11:34 +07:00
24822f5408 feat(lane_route): add lane_route_core and lane_route_planner (R0 + R1)
lane_route_core plans on a precomputed coarse graph (Voronoi ridges and
direction-zone lanes) and, when enabled, falls back to a weighted A*
search over an SE(2) lattice that enforces forward motion, the minimum
turn radius, end-only spins, the footprint gap and direction zones.

- R0: route_planner.cpp split into graph search, path building and the
  graph tier; regress7 output identical to the previous build.
- R1: lattice tier (lazy packed C-space tiles, direction-aware heuristic
  field, analytic Dubins and point connectors, end-gap floors counting
  unknown cells). Off by default (lattice_enabled = false).
- lane_route_eval takes an optional tier mode and LANE_ROUTE_EVAL_SET
  overrides for offline tuning.

Local snapshot for history only; not pushed.
2026-11-09 13:44:17 +07:00