Skip to main content

Module path

Module path 

Source
Expand description

Path abstraction for trajectory planning.

The main entry point is Path. Pick the constructor by the path data you own:

You haveUseNotes
Analytic formula q(s)Path::from_parametricComputes derivatives up to third order by Jet3 automatic differentiation.
Waypoints the path must pass throughPath::from_waypoints_interpolatingInterpolates every column of a (dim x n_points) waypoint matrix.
A reference polyline that may be approximatedPath::from_waypoints_fittingC4 quintic fitting; per-axis tolerance defaults to 0.001.
Explicit q/dq/ddq evaluatorPath::from_evaluator_2ndUse for TOPP2/COPP2 or other workflows that do not need jerk. See PathEvaluator2nd.
Explicit q/dq/ddq/dddq evaluatorPath::from_evaluator_3rdUse for TOPP3/COPP3 workflows. See PathEvaluator3rd.

The waypoint constructor families also provide borrowed-view companions: Path::from_waypoints_interpolating_view and Path::from_waypoints_fitting_view. They accept compatible strided column-major nalgebra views without requiring callers to first materialize a DMatrix.

§Interpolating versus fitting waypoint paths

Path::from_waypoints_interpolating constrains the path to pass through every input waypoint at its assigned parameter, up to floating-point roundoff. Choose it when each waypoint is a position or event that must be retained.

Path::from_waypoints_fitting instead treats adjacent columns as a reference polyline under one common parameter. The fitted curve is not required to pass through interior waypoints: selected axes may deviate from them within their configured tolerances. Their absolute error at the same parameter is numerically audited over every complete reference interval, while endpoint positions are retained up to floating-point roundoff. Configure axis selection, parameters, tolerances, and construction budgets with SmoothingConfig and SmoothingTolerance; inspect final bounds and refinement work through SmoothingReport.

Fitting is geometric preprocessing, not time parameterization. Values from the evaluation methods below are derivatives with respect to s; physical velocity, acceleration, and jerk also depend on the later time law s(t).

§API stability

The waypoint interpolation and fitting constructor families, including their _view variants, are currently unstable. As additional algorithms are introduced, their names, signatures, configuration types, and method-selection interfaces may change in future releases.

Once built, call one of the evaluation methods with a one-dimensional parameter slice:

MethodOutput
Path::evaluate_qposition q only
Path::evaluate_up_to_2ndq, dq, ddq
Path::evaluate_up_to_3rdq, dq, ddq, dddq

Re-exports§

pub use autodiff::Jet3;
pub use autodiff::cos;
pub use autodiff::exp;
pub use autodiff::ln;
pub use autodiff::powi;
pub use autodiff::sin;
pub use autodiff::sqrt;
pub use spline::Parametrization;
pub use spline::SplineConfig;

Modules§

autodiff
Third-order forward-mode automatic differentiation primitives.
spline
Waypoint-based spline path construction and evaluation kernels.

Structs§

Path
Unified path abstraction over parametric, spline, and evaluator representations.
PathDerivatives
Output of path evaluation.
SmoothingConfig
Configuration for tolerance-bounded waypoint fitting.
SmoothingReport
Diagnostics recorded while constructing a smoothed waypoint path.

Enums§

OutOfRangeMode
Policy for handling path queries outside the configured s range.
SmoothingTolerance
Absolute deviation limits for the axes selected for smoothing.

Traits§

PathEvaluator
Compatibility alias for third-order explicit path evaluators.
PathEvaluator2nd
User-provided path evaluator with explicit derivatives up to second order.
PathEvaluator3rd
User-provided path evaluator with explicit derivatives up to third order.

Type Aliases§

ParametricFn
Shared analytic path function used by Path::from_parametric.