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:
@@ -1,6 +1,7 @@
|
||||
#ifndef LANE_ROUTE_CORE_LATTICE_INTERNAL_H_
|
||||
#define LANE_ROUTE_CORE_LATTICE_INTERNAL_H_
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
@@ -53,9 +54,11 @@ struct LatticeContext
|
||||
TimePoint deadline;
|
||||
PlanInfo& info;
|
||||
LatticeMemory& memory;
|
||||
uint64_t* smooth_checks = nullptr;
|
||||
uint64_t smooth_limit = 0;
|
||||
|
||||
bool cancelled() const { return request.cancel && request.cancel->load(std::memory_order_relaxed); }
|
||||
bool expired() const { return cancelled() || Clock::now() >= deadline; }
|
||||
bool expired() const { return cancelled() || Clock::now() >= deadline || (smooth_checks && *smooth_checks >= smooth_limit); }
|
||||
};
|
||||
|
||||
struct LatticeTierInput
|
||||
@@ -65,8 +68,17 @@ struct LatticeTierInput
|
||||
const PlannerConfig& config;
|
||||
double deviation_deg;
|
||||
TimePoint deadline;
|
||||
TimePoint smooth_deadline;
|
||||
};
|
||||
|
||||
class LatticeCSpace;
|
||||
struct LatticeMotion { double curvature; double length; };
|
||||
struct LatticeDubinsWord { std::array<LatticeMotion, 3> motion; double length; };
|
||||
int latticeDubinsWords(const PathPoint& start, double x, double y, double yaw, double radius,
|
||||
std::array<LatticeDubinsWord, 6>* words);
|
||||
bool latticeAppendMotion(LatticeContext& context, LatticeCSpace& space, const LatticeMotion& motion, Path* path, bool check = true);
|
||||
bool latticeAppendSpin(LatticeContext& context, LatticeCSpace& space, double yaw, Path* path);
|
||||
|
||||
struct LatticeStateKey
|
||||
{
|
||||
int32_t x, y, heading;
|
||||
@@ -146,6 +158,7 @@ bool rejectLatticeCrossing(LatticeContext& context, const Path& path);
|
||||
bool verifyLatticeCandidate(LatticeContext& context, const Path& path, PathCheck* check);
|
||||
bool buildLatticeField(LatticeContext& context, LatticeField* field, TimePoint field_deadline);
|
||||
bool searchLattice(LatticeContext& context, LatticeCSpace& space, const LatticeField& field, Path* path, PathCheck* check);
|
||||
void smoothLatticePath(LatticeContext& context, LatticeCSpace& space, Path* path, PathCheck* check);
|
||||
bool planLatticeTier(const LatticeTierInput& input, GraphTierOutput output);
|
||||
|
||||
} // namespace detail
|
||||
|
||||
Reference in New Issue
Block a user