COPP C++ API 0.2.3
C++ interface for COPP trajectory optimization
Loading...
Searching...
No Matches
copp::solver::topp3::Problem Class Reference

Prepared TOPP3 problem descriptor. More...

#include <topp3.hpp>

Public Member Functions

 Problem (ConstraintsRef constraints, Span< const double > a_linearization, std::size_t idx_s_start=0, Boundary3 boundary={}, StationaryBounds num_stationary_max={}, double a_linearization_floor=1.0e-10, Span< const double > b_linearization={})
 Prepare a third-order problem and immediately linearize constraints.
 Problem (ConstraintsRef constraints, Span< const double > a_linearization, std::size_t idx_s_start, Boundary3 boundary, std::size_t symmetric_num_stationary_max, double a_linearization_floor=1.0e-10, Span< const double > b_linearization={})
ConstraintsRef constraints () const noexcept
const std::vector< double > & a_linearization () const noexcept
const std::vector< double > & b_linearization () const noexcept
 Copied b_linearization; empty when direct linearization is used.
std::size_t idx_s_start () const noexcept
std::size_t idx_s_final () const noexcept
Boundary3 boundary () const noexcept
StationaryBounds num_stationary_max () const noexcept
StationaryBounds num_stationary () const noexcept
double a_linearization_floor () const noexcept
std::size_t s_len () const noexcept

Detailed Description

Prepared TOPP3 problem descriptor.

Construction borrows a ConstraintsRef, owns a copy of a_linearization, infers idx_s_final, and immediately asks Rust to linearize third-order constraints into the underlying constraint cache. The owning Robot or Constraints object must outlive this problem and solver calls using it.

By default every third-order row of a station is linearized directly at a_linearization[k]. Passing a non-empty b_linearization selects adaptive anchoring (Rust LinearizationModeTopp3::GivenFeasibleAdaptive): each row is anchored where it is nearly active at the feasible state (a_linearization, b_linearization). This requires a_linearization and b_linearization to be the a and b of the same previously solved third-order profile, with equal length; a TOPP2 profile discretizes b differently and must not be used. Prefer it when a spans a wide range over the window, and especially when a can approach zero (around 1e-10): anchoring both rows of one axis at the same small a_linearization[k] cancels b and c and leaves a[k] <= 3 * a_linearization[k]. On profiles well away from zero the default direct linearization is cheaper and nearly identical.

auto profile = copp::solver::topp3_socp::solve(problem, options);
constraints.ref(), profile.a, 0, boundary, 1, 1.0e-10, profile.b};
Prepared TOPP3 problem descriptor.
Definition topp3.hpp:63
Boundary3 boundary() const noexcept
Definition topp3.hpp:105
ConstraintsRef constraints() const noexcept
Definition topp3.hpp:99
COPP_API Profile3rd solve(const Problem &problem, const clarabel::Options &options={})
Solve TOPP3-SOCP and return an accepted third-order profile.

Definition at line 62 of file topp3.hpp.

Constructor & Destructor Documentation

◆ Problem() [1/2]

copp::solver::topp3::Problem::Problem ( ConstraintsRef constraints,
Span< const double > a_linearization,
std::size_t idx_s_start = 0,
Boundary3 boundary = {},
StationaryBounds num_stationary_max = {},
double a_linearization_floor = 1.0e-10,
Span< const double > b_linearization = {} )

Prepare a third-order problem and immediately linearize constraints.

Parameters
constraintsBorrowed constraint buffer. The owner must outlive this problem and all solver calls.
a_linearizationNode profile used for linearizing jerk constraints.
idx_s_startGlobal station id of a_linearization[0].
boundaryEndpoint values for a = dot{s}^2 and b = ddot{s}.
num_stationary_maxUpper bounds for inferred stationary boundary intervals.
a_linearization_floorLower numerical floor applied by Rust.
b_linearizationOptional node profile b = ddot{s} paired with a_linearization. Empty (default) selects direct linearization; non-empty selects adaptive anchoring and must have the same length as a_linearization. The values are copied.
Exceptions
copp::Errorif the interval, boundary, or linearization is invalid.

◆ Problem() [2/2]

copp::solver::topp3::Problem::Problem ( ConstraintsRef constraints,
Span< const double > a_linearization,
std::size_t idx_s_start,
Boundary3 boundary,
std::size_t symmetric_num_stationary_max,
double a_linearization_floor = 1.0e-10,
Span< const double > b_linearization = {} )

Member Function Documentation

◆ constraints()

ConstraintsRef copp::solver::topp3::Problem::constraints ( ) const
inlinenoexcept

Definition at line 99 of file topp3.hpp.

◆ a_linearization()

const std::vector< double > & copp::solver::topp3::Problem::a_linearization ( ) const
inlinenoexcept

Definition at line 100 of file topp3.hpp.

◆ b_linearization()

const std::vector< double > & copp::solver::topp3::Problem::b_linearization ( ) const
inlinenoexcept

Copied b_linearization; empty when direct linearization is used.

Definition at line 102 of file topp3.hpp.

◆ idx_s_start()

std::size_t copp::solver::topp3::Problem::idx_s_start ( ) const
inlinenoexcept

Definition at line 103 of file topp3.hpp.

◆ idx_s_final()

std::size_t copp::solver::topp3::Problem::idx_s_final ( ) const
inlinenoexcept

Definition at line 104 of file topp3.hpp.

◆ boundary()

Boundary3 copp::solver::topp3::Problem::boundary ( ) const
inlinenoexcept

Definition at line 105 of file topp3.hpp.

◆ num_stationary_max()

StationaryBounds copp::solver::topp3::Problem::num_stationary_max ( ) const
inlinenoexcept

Definition at line 106 of file topp3.hpp.

◆ num_stationary()

StationaryBounds copp::solver::topp3::Problem::num_stationary ( ) const
inlinenoexcept

Definition at line 107 of file topp3.hpp.

◆ a_linearization_floor()

double copp::solver::topp3::Problem::a_linearization_floor ( ) const
inlinenoexcept

Definition at line 108 of file topp3.hpp.

◆ s_len()

std::size_t copp::solver::topp3::Problem::s_len ( ) const
inlinenoexcept

Definition at line 109 of file topp3.hpp.


The documentation for this class was generated from the following file: