Geometric path wrapper backed by Rust Path. More...
#include <path.hpp>
Public Member Functions | |
| Path (Path &&) noexcept | |
| Path & | operator= (Path &&) noexcept |
| ~Path () | |
| Path (const Path &)=delete | |
| Path & | operator= (const Path &)=delete |
| std::size_t | dim () const |
| Return the path dimension. | |
| std::pair< double, double > | s_range () const |
| Return the valid path-parameter interval (s_min, s_max). | |
| PathDerivatives | evaluate_q (Span< const double > s) const |
| Evaluate position samples only. | |
| Expected< PathDerivatives > | evaluate_q (Span< const double > s, NoThrowTag) const |
| PathDerivatives | evaluate_up_to_2nd (Span< const double > s) const |
| Evaluate position, first derivative, and second derivative. | |
| Expected< PathDerivatives > | evaluate_up_to_2nd (Span< const double > s, NoThrowTag) const |
| PathDerivatives | evaluate_up_to_3rd (Span< const double > s) const |
| Evaluate position, first derivative, second derivative, and third derivative. | |
| Expected< PathDerivatives > | evaluate_up_to_3rd (Span< const double > s, NoThrowTag) const |
Static Public Member Functions | |
| static Path | from_waypoints (MatrixView waypoints, SplineConfig config={}) |
| Build a spline path from waypoint positions. | |
| static Expected< Path > | from_waypoints (MatrixView waypoints, SplineConfig config, NoThrowTag) |
| static Expected< Path > | from_waypoints (MatrixView waypoints, NoThrowTag) |
| static Path | from_waypoints (std::initializer_list< std::initializer_list< double > > waypoints, SplineConfig config={}) |
| Build a spline path from waypoint-list notation. | |
| static Expected< Path > | from_waypoints (std::initializer_list< std::initializer_list< double > > waypoints, SplineConfig config, NoThrowTag) |
| static Expected< Path > | from_waypoints (std::initializer_list< std::initializer_list< double > > waypoints, NoThrowTag) |
| static Path | from_parametric (PathParametric parametric, double s_min, double s_max) |
| Build a path from a scalar-parametric formula. | |
| static Expected< Path > | from_parametric (PathParametric parametric, double s_min, double s_max, NoThrowTag) |
| static Path | from_parametric (std::size_t dim, double s_min, double s_max, PathParametricWriter parametric) |
| Build a path from a scalar-parametric formula that writes into a buffer. | |
| static Expected< Path > | from_parametric (std::size_t dim, double s_min, double s_max, PathParametricWriter parametric, NoThrowTag) |
| static Path | from_evaluator_2nd (std::size_t dim, double s_min, double s_max, PathEvaluator2nd evaluator) |
| Build a path from a batch evaluator with explicit derivatives up to second order. | |
| static Expected< Path > | from_evaluator_2nd (std::size_t dim, double s_min, double s_max, PathEvaluator2nd evaluator, NoThrowTag) |
| static Path | from_evaluator_3rd (std::size_t dim, double s_min, double s_max, PathEvaluator3rd evaluator) |
| Build a path from a batch evaluator with explicit derivatives up to third order. | |
| static Expected< Path > | from_evaluator_3rd (std::size_t dim, double s_min, double s_max, PathEvaluator3rd evaluator, NoThrowTag) |
Friends | |
| const void * | detail::path_handle (const Path &path) noexcept |
Geometric path wrapper backed by Rust Path.
Path owns a Rust-side path handle through the cxx bridge. It is movable but not copyable. The C++ public API exposes RAII ownership and throws copp::Error on construction or evaluation failure.
|
noexcept |
| copp::Path::~Path | ( | ) |
|
delete |
|
static |
Build a spline path from waypoint positions.
waypoints is a (dim x n_points) matrix where each column is one waypoint. At least one dimension and two waypoint columns are required.
Column-major views can cross the bridge directly. Row-major views are accepted for convenience and copied once into column-major storage before calling Rust.
The input view only needs to remain valid during this call; the returned Path owns the constructed Rust path.
| waypoints | Borrowed waypoint matrix. |
| config | Spline order, parameter range, and out-of-range policy. |
| copp::Error | on invalid shape, invalid config, or Rust spline construction failure. |
|
inlinestatic |
|
inlinestatic |
|
static |
Build a spline path from waypoint-list notation.
Each inner list is one waypoint vector. The example below creates a two-dimensional path through three waypoints:
| waypoints | Outer list of waypoint vectors, not matrix rows. |
| config | Spline construction options. |
| copp::Error | if the waypoint list is empty, ragged, or invalid. |
|
inlinestatic |
|
inlinestatic |
|
static |
Build a path from a scalar-parametric formula.
The callback receives a seeded Jet3 value and returns one Jet3 per path dimension. The dimension is inferred by probing the callback once at the midpoint of [s_min, s_max]. Derivatives up to third order are propagated by Jet3 arithmetic.
| parametric | Function from scalar s to a vector-valued path. |
| s_min | Lower bound of the valid path range. |
| s_max | Upper bound of the valid path range. |
| copp::Error | if the callback is empty, returns zero or inconsistent dimension, throws during probing/evaluation, or the range is invalid. |
|
inlinestatic |
|
static |
Build a path from a scalar-parametric formula that writes into a buffer.
This overload avoids allocating a std::vector<Jet3> on each path sample. The callback must write exactly dim entries into q.
| dim | Path dimension / number of entries written by the callback. |
| s_min | Lower bound of the valid path range. |
| s_max | Upper bound of the valid path range. |
| parametric | Allocation-free writer callback. |
|
inlinestatic |
|
static |
Build a path from a batch evaluator with explicit derivatives up to second order.
The returned Path owns the callback. dim must be positive and remain consistent with the callback's output writes. The path range must satisfy finite s_min < s_max.
| dim | Path dimension. |
| s_min | Lower range endpoint. |
| s_max | Upper range endpoint. |
| evaluator | Batch callback that fills q, dq, and ddq. |
| copp::Error | on invalid dimensions/range or callback failure. |
|
inlinestatic |
|
static |
Build a path from a batch evaluator with explicit derivatives up to third order.
The returned Path owns the callback. dim must be positive and remain consistent with the callback's output writes. The path range must satisfy finite s_min < s_max.
A third-order evaluator can also be used by TOPP2/COPP2 workflows; the facade requests only the derivatives that each solver needs.
|
inlinestatic |
| std::size_t copp::Path::dim | ( | ) | const |
Return the path dimension.
| std::pair< double, double > copp::Path::s_range | ( | ) | const |
Return the valid path-parameter interval (s_min, s_max).
| PathDerivatives copp::Path::evaluate_q | ( | Span< const double > | s | ) | const |
Evaluate position samples only.
Returns PathDerivatives with q populated and derivative fields empty.
| s | Query samples. |
| copp::Error | if samples are invalid or the underlying evaluator fails. |
|
inline |
| PathDerivatives copp::Path::evaluate_up_to_2nd | ( | Span< const double > | s | ) | const |
Evaluate position, first derivative, and second derivative.
Returns q, dq, and ddq, each with shape (dim, s.size()).
| s | Query samples. |
|
inline |
| PathDerivatives copp::Path::evaluate_up_to_3rd | ( | Span< const double > | s | ) | const |
Evaluate position, first derivative, second derivative, and third derivative.
Returns q, dq, ddq, and dddq, each with shape (dim, s.size()).
| s | Query samples. |
|
inline |
|
friend |