Skip to main content

Crate deke_multipath

Crate deke_multipath 

Source
Expand description

Optimal ordering and orientation of required robot paths.

Given a set of paths that must each be traversed exactly once — some of which may be reversible or have several interchangeable realizations — this crate chooses one option per required path and orders them to minimise total motion cost, starting at a configuration and optionally ending at one. It returns the full stitched motion: connector segments interleaved with the chosen required paths.

The ordering is an asymmetric generalized TSP (see [agtsp]); cost is a pluggable joint-space metric (TransitionCost). The planner is only used to generate connector paths and is optional — plan_multipath uses a planner for obstacle-aware connectors, plan_multipath_straight emits validated straight-line connectors instead.

let settings = MultiPathSettings::new(start);
let cost = TransitionCost::JointWeighted(weights);
let transition = TransitionPlanner { planner, config: cfg, make_waypoints: make_wp };
plan_multipath(&paths, &cost, &settings, &transition, validator, ctx)

§Feature flags

  • rayon — use rayon to plan connectors concurrently and to fan out the heuristic’s seed tours. Worth enabling when connector planning is the bottleneck (real collision-checked RRT, where each plan costs milliseconds) or for large heuristic instances; for trivially cheap connectors the thread-pool dispatch can cost more than it saves. The exact Held–Karp solver stays sequential — its layers depend on one another, so it does not parallelize without a structural rewrite. Enabling it adds Sync bounds on the planner, its config, the waypoint builder, and the validator context (all satisfied by the deke planners/validators).

Structs§

MultiPathSettings
Knobs for a multipath solve. Build with MultiPathSettings::new.
TransitionPlanner
Everything needed to generate real connector paths with a deke planner. The make_waypoints closure bridges the planner’s associated Waypoints type — for the RRT planners that is |s, e| StartEnd { start: s, end: e }.

Enums§

MultipathError
Failure modes specific to multipath solving, layered over DekeError for the underlying planning / validation / path-construction failures that flow up from the deke primitives.
ReqPath
A path that must be traversed exactly once, with the directions or variants the solver is free to choose between. Every variant collapses to a set of directed option paths; the solver picks exactly one option per ReqPath.
TransitionCost
How a transition between two configurations is scored when ordering the required paths. This drives the AGTSP only — the connector paths in the output are produced separately (by the planner or by straight-line segments).

Functions§

plan_multipath
Solve the ordering and stitch the full motion using transition to plan obstacle-aware connectors between the chosen paths.
plan_multipath_straight
Solve the ordering and stitch the full motion using straight joint-space connectors. Each connector is checked with validator.validate_motion; if a straight line between two required paths is infeasible the solve fails (there is no planner to route around the obstacle).
weighted_distance
Weighted joint-space distance sqrt(Σ (wᵢ·(aᵢ-bᵢ))²). Note this is not SRobotQ::distance, which is unweighted.

Type Aliases§

MultipathResult