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.
This commit is contained in:
2026-11-09 17:42:48 +07:00
parent b0a3954541
commit d27cff23bd
11 changed files with 308 additions and 13 deletions

View File

@@ -126,6 +126,8 @@ void applyOverrides(PlannerConfig* config)
return;
const std::map<std::string, double*> doubles{
{ "lattice_closed_resolution_m", &config->lattice_closed_resolution_m },
{ "lattice_preferred_gap_m", &config->lattice_preferred_gap_m },
{ "lattice_preferred_time_fraction", &config->lattice_preferred_time_fraction },
{ "lattice_heuristic_weight", &config->lattice_heuristic_weight },
{ "lattice_bucket_width_m", &config->lattice_bucket_width_m },
{ "lattice_field_clearance_weight_m", &config->lattice_field_clearance_weight_m },
@@ -360,7 +362,13 @@ int main(int argc, char** argv)
<< ",\"lattice_smooth_connectors_ok\":" << info.lattice_smooth_connectors_ok
<< ",\"lattice_smooth_candidates\":" << info.lattice_smooth_candidates
<< ",\"lattice_smooth_rejects_verify\":" << info.lattice_smooth_rejects_verify
<< ",\"lattice_smooth_stop\":\"" << info.lattice_smooth_stop << "\"}\n";
<< ",\"lattice_smooth_stop\":\"" << info.lattice_smooth_stop << "\""
<< ",\"lattice_gap_pass\":\"" << info.lattice_gap_pass << "\""
<< ",\"lattice_gap_exact\":" << (info.lattice_gap_exact ? 1 : 0)
<< ",\"lattice_min_gap_m\":";
if (result.ok && info.tier_used == "lattice" && std::isfinite(info.min_gap_m)) out << info.min_gap_m;
else out << "null";
out << ",\"lattice_upgrade_ms\":" << info.lattice_upgrade_ms << "}\n";
std::cout << id << " " << deviation << " " << info.reason << " " << info.query_ms << " ms" << std::endl;
}
}