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.
This commit is contained in:
2026-11-09 20:09:43 +07:00
parent d27cff23bd
commit 907fa0c4dc
8 changed files with 149 additions and 14 deletions

View File

@@ -2032,3 +2032,31 @@ TEST(LatticePreferredGap, ChangingMarginInvalidatesCachedPoses)
space.setGapMargin(config.footprint_min_gap_m);
EXPECT_TRUE(space.poseFree(3.5, 2.525, 0.0));
}
TEST(LatticeTightArcs, TurnRadiusSettingsAreValidated)
{
PlannerConfig config = latticeConfig();
config.lattice_tight_turn_cost_m = -0.1;
EXPECT_FALSE(config.validate().empty());
config = latticeConfig();
config.regular_turn_radius_m = 0.0;
EXPECT_FALSE(config.validate().empty());
// A regular radius below the floor acts as the floor; it must not stop the planner from starting.
config = latticeConfig();
config.regular_turn_radius_m = 0.5;
EXPECT_TRUE(config.validate().empty());
}
TEST(LatticeTightArcs, OpenSpaceKeepsRegularRadius)
{
// With a 0.4 m floor and the optional tight arcs on, no tight turn saves enough path in open space to pay its cost.
LatticeTestGrid map(160, 160);
PlannerConfig config = latticeConfig();
config.min_turn_radius_m = 0.4;
config.lattice_tight_arcs = true;
const auto result = map.plan(latticeRequest(pose(1.0, 1.0, 0.0), pose(5.5, 5.5, kPi / 2.0)), config);
ASSERT_TRUE(result.ok) << result.info.reason;
EXPECT_EQ(result.info.tier_used, "lattice");
for (const PathPoint& point : result.path)
EXPECT_LE(std::abs(point.curvature), 1.0 / 1.06 + 1e-6);
}