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 24822f5408
commit b0a3954541
13 changed files with 946 additions and 20 deletions

View File

@@ -149,6 +149,10 @@ void applyOverrides(PlannerConfig* config)
const std::map<std::string, int64_t*> longs{
{ "lattice_field_max_cells", &config->lattice_field_max_cells },
{ "lattice_max_memory_mb", &config->lattice_max_memory_mb },
{ "lattice_smooth_max_checks", &config->lattice_smooth_max_checks },
};
const std::map<std::string, bool*> bools{
{ "lattice_smooth_enabled", &config->lattice_smooth_enabled },
};
std::stringstream stream(text);
std::string item;
@@ -165,6 +169,8 @@ void applyOverrides(PlannerConfig* config)
*ints.at(key) = std::stoi(value);
else if (longs.count(key) != 0)
*longs.at(key) = std::stoll(value);
else if (bools.count(key) != 0)
*bools.at(key) = std::stoi(value) != 0;
else
throw std::runtime_error("unknown LANE_ROUTE_EVAL_SET key: " + key);
std::cerr << "override " << key << "=" << value << std::endl;
@@ -346,7 +352,15 @@ int main(int argc, char** argv)
<< ",\"lattice_crossing_rejects\":" << info.lattice_crossing_rejects
<< ",\"lattice_field_ms\":" << info.lattice_field_ms << ",\"lattice_search_ms\":" << info.lattice_search_ms
<< ",\"lattice_verify_ms\":" << info.lattice_verify_ms
<< ",\"lattice_ms\":" << info.lattice_ms << "}\n";
<< ",\"lattice_ms\":" << info.lattice_ms
<< ",\"lattice_smooth_ms\":" << info.lattice_smooth_ms << ",\"lattice_smooth_checks\":" << info.lattice_smooth_checks
<< ",\"lattice_smoothed\":" << info.lattice_smoothed << ",\"curvature_sign_changes\":" << info.curvature_sign_changes
<< ",\"path_length_m\":" << info.path_length_m << ",\"straight_share\":" << info.straight_share
<< ",\"lattice_smooth_connectors_tried\":" << info.lattice_smooth_connectors_tried
<< ",\"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";
std::cout << id << " " << deviation << " " << info.reason << " " << info.query_ms << " ms" << std::endl;
}
}