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.
This commit is contained in:
2026-11-09 16:11:34 +07:00
parent 0c2179fe54
commit ad326f535c
5 changed files with 272 additions and 49 deletions

View File

@@ -10,6 +10,30 @@ The cached compiled graphs are dropped when the reference generation, footprint,
or the exact preferred-cell mask changes. Other master costs are read again at query time. The core
uses the worker's ridge parameters for a live rebuild. `time_limit_s` defaults to 20 seconds.
## Lattice fallback
The optional weighted A* SE(2) lattice runs after an eligible graph-tier failure. It retains the
core's forward-only, curvature, end-spin, footprint-gap and direction-zone checks. It is off by
default; set `lattice_enabled: true` to enable it. The sim/dev runtime YAML enables it for testing.
The fallback shares `time_limit_s` and has its own `fallback_time_limit_s` budget across rungs and
smoothing; a graph result or an early failure can prevent it from running.
Keys (defaults from `PlannerConfig`):
- `lattice_enabled: false`, `lattice_heading_bins: 72`, `lattice_closed_resolution_m: 0.10`,
`lattice_heuristic_weight: 3.0`, `lattice_bucket_width_m: 0.25`.
- `lattice_field_clearance_weight_m: 0.25`, `lattice_wall_weight_m: 0.25`,
`lattice_switch_cost_m: 0.35`, `lattice_steer_cost_m: 0.012`.
- `lattice_primitive_multiple_1: 1`, `lattice_primitive_multiple_2: 3`,
`lattice_primitive_multiple_3: 6`.
- `lattice_analytic_radius_m: 1.08`, `lattice_analytic_interval: 20000`,
`lattice_analytic_near_goal_m: 2.0`, `lattice_analytic_goal_headings: 16`.
- `lattice_field_time_fraction: 0.4`, `lattice_field_cell_factor: 0`,
`lattice_field_max_cells: 1000000`, `fallback_time_limit_s: 3.0`,
`lattice_end_relax_radius_m: 1.0`, `lattice_max_memory_mb: 512` (MiB).
- `debug/fallback: true` enables one diagnostic line per request when lattice ran; failure logs
remain enabled. See the runtime YAML for units, tuning effects and valid ranges.
Cancellation is checked during graph compilation and core planning. Preferred-region centre-line
extraction does not itself accept cancellation: a request arriving during that call waits until it
returns. It runs only on compilation when the master has preferred cells; its worst-case time is
@@ -19,6 +43,6 @@ Master cost 100 is interpreted as UNPREFERRED. Inflation can produce exactly 100
parameter sets, causing a small penalty and potentially an extra neutral pass on failure. The
current inflation parameters have not produced that value; no normalization is applied.
The session tests exercise snapshots and grids without a real Costmap2DROBOT. Plugin loading,
NodeHandle parameter discovery, external-grid lifetime, snapshot synchronization, output headers,
The tests exercise snapshots, grids and NodeHandle configuration without a real Costmap2DROBOT. Plugin loading,
runtime parameter discovery, external-grid lifetime, snapshot synchronization, output headers,
and integration with the navigation host still require runtime validation.