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.
This commit is contained in:
2026-11-09 23:30:46 +07:00
parent 88a2328ae8
commit ebb7b01333
2 changed files with 10 additions and 3 deletions

View File

@@ -40,8 +40,13 @@ Keys (defaults from `PlannerConfig`):
use only radii at or above it, as before. When `min_turn_radius_m` is lower, the graph adds a second
pass with all `corner_radii_m` (largest first) if the first pass fails or returns a long detour, and
keeps it only when it is at least 20% shorter.
- `max_kink_deg: 45`: bottom rung of the ladder. In the graph's second pass, a corner where no radius fits may become a sharp
corner (two straight lines meeting at a vertex, no turn in place) up to this heading change, when the footprint can rotate
at the vertex without touching an obstacle. The verifier counts such corners in `PathCheck::corners`. 0 disables them.
- `lattice_tight_arcs: false`, `lattice_tight_turn_cost_m: 0.15`: optional lattice arcs at
`min_turn_radius_m`; off because they cost many regress7 queries to timeouts.
- `lattice_field_extra_clearance_m: 0.0`: extra clearance a cell needs in the lattice heuristic field only, so the field
stays out of gaps barely wider than the robot; when that closes the only way to the start, the plain field is rebuilt.
- `debug/dump_dir: ""`, `debug/dump_max_files: 20`: when the directory is set, each failed query
writes its static cost, master cost, direction codes and poses as `lane_route_eval` input
(`<stem>.grid`, `.live`, `.scene`, `.txt`), at most that many per session. Off by default because

View File

@@ -51,6 +51,8 @@ SessionConfig loadSessionConfig(const robot::NodeHandle& nh)
const auto& d = defaults.planner;
load("min_turn_radius_m", p.min_turn_radius_m, d.min_turn_radius_m);
load("corner_radii_m", p.corner_radii_m, d.corner_radii_m);
load("regular_turn_radius_m", p.regular_turn_radius_m, d.regular_turn_radius_m);
load("max_kink_deg", p.max_kink_deg, d.max_kink_deg);
load("clearance_min_margin_m", config.clearance_min_margin_m, defaults.clearance_min_margin_m);
load("clearance_preferred_margin_m", config.clearance_preferred_margin_m, defaults.clearance_preferred_margin_m);
load("collision_check_margin_m", config.collision_check_margin_m, defaults.collision_check_margin_m);
@@ -69,7 +71,6 @@ SessionConfig loadSessionConfig(const robot::NodeHandle& nh)
load("live_ridge_max_cells", max_cells, max_cells);
p.live_ridge_max_cells = max_cells;
load("lattice_enabled", p.lattice_enabled, d.lattice_enabled);
load("regular_turn_radius_m", p.regular_turn_radius_m, d.regular_turn_radius_m);
load("lattice_tight_turn_cost_m", p.lattice_tight_turn_cost_m, d.lattice_tight_turn_cost_m);
load("lattice_tight_arcs", p.lattice_tight_arcs, d.lattice_tight_arcs);
load("lattice_preferred_gap_m", p.lattice_preferred_gap_m, d.lattice_preferred_gap_m);
@@ -93,6 +94,7 @@ SessionConfig loadSessionConfig(const robot::NodeHandle& nh)
load("lattice_analytic_interval", p.lattice_analytic_interval, d.lattice_analytic_interval);
load("lattice_analytic_near_goal_m", p.lattice_analytic_near_goal_m, d.lattice_analytic_near_goal_m);
load("lattice_analytic_goal_headings", p.lattice_analytic_goal_headings, d.lattice_analytic_goal_headings);
load("lattice_field_extra_clearance_m", p.lattice_field_extra_clearance_m, d.lattice_field_extra_clearance_m);
load("lattice_field_time_fraction", p.lattice_field_time_fraction, d.lattice_field_time_fraction);
load("lattice_field_cell_factor", p.lattice_field_cell_factor, d.lattice_field_cell_factor);
int field_max_cells = static_cast<int>(d.lattice_field_max_cells);
@@ -168,9 +170,9 @@ bool LaneRoutePlanner::initialize(std::string name, robot_costmap_2d::Costmap2DR
p.lattice_enabled, p.fallback_time_limit_s, p.lattice_preferred_gap_m, p.lattice_preferred_time_fraction,
p.lattice_smooth_enabled, static_cast<long long>(p.lattice_smooth_max_checks), p.lattice_heuristic_weight, p.lattice_heading_bins,
static_cast<long long>(p.lattice_max_memory_mb), config_.debug_fallback);
robot::log_info("[lane_route_planner] radii: min_turn_radius_m=%.3f corner_radii_m=%zu values %.3f..%.3f regular_turn_radius_m=%.3f lattice_tight_arcs=%d lattice_tight_turn_cost_m=%.3f",
robot::log_info("[lane_route_planner] radii: min_turn_radius_m=%.3f corner_radii_m=%zu values %.3f..%.3f regular_turn_radius_m=%.3f max_kink_deg=%.1f lattice_tight_arcs=%d lattice_tight_turn_cost_m=%.3f",
p.min_turn_radius_m, p.corner_radii_m.size(), p.corner_radii_m.front(), p.corner_radii_m.back(),
p.regular_turn_radius_m, p.lattice_tight_arcs, p.lattice_tight_turn_cost_m);
p.regular_turn_radius_m, p.max_kink_deg, p.lattice_tight_arcs, p.lattice_tight_turn_cost_m);
robot::log_info("[lane_route_planner] debug/dump_dir='%s' debug/dump_max_files=%d (empty dir: no failure dumps)",
config_.debug_dump_dir.c_str(), config_.debug_dump_max_files);
if (costmap_->getLayeredCostmap()->getReferenceGraphSnapshot().state == robot_costmap_2d::ReferenceGraphState::kDisabled)