COPP solvers optimize convex objectives in addition to satisfying TOPP-style constraints. Clarabel-backed solvers also expose raw solver settings and expert diagnostics.
Include
or:
Objective Descriptors
Objective factories live in copp::objective:
std::vector<copp::Objective> objectives{
};
Objective ThermalEnergy(double weight, Span< const double > normalize)
Objective Time(double weight=1.0)
The built-in objective support is:
| Objective | COPP2-SOCP | COPP3-SOCP |
| Time | yes | yes |
| ThermalEnergy | yes | yes |
| Linear | yes | yes |
| TotalVariationTorque | yes | yes |
For Linear, expected vector lengths depend on solver order:
- COPP2: alpha.size() == s_len, beta.size() == s_len - 1
- COPP3: alpha.size() == s_len, beta.size() == s_len
Torque-related objectives use the robot's inverse-dynamics callback when one is installed. Otherwise they use point-mass dynamics tau = ddq.
Clarabel Options
copp::clarabel::Options combines COPP's acceptance policy with raw Clarabel settings:
Shared Clarabel options for COPP/TOPP SOCP-style solvers.
Settings clarabel_settings
copp::clarabel::Settings mirrors the current raw Clarabel setting surface, so advanced users can tune tolerances, iteration limits, linear solver choices, and equilibration behavior without dropping down to Rust.
Expert Results
solve returns only an accepted profile:
COPP_API std::vector< double > solve(const Problem &problem, const clarabel::Options &options={})
Solve COPP2-SOCP and return an accepted node profile a(s).
solve_expert returns diagnostics even when no profile is accepted:
if (expert.a) {
std::cout << "accepted profile length = " << expert.a->size() << "\n";
} else {
std::cout << "Clarabel status = "
<< static_cast<int>(expert.solver_status)
<< ", iterations = "
<< expert.iterations
<< "\n";
}
COPP_API Result solve_expert(const Problem &problem, const clarabel::Options &options={})
Solve COPP2-SOCP and always return Clarabel diagnostics.
Expert results include raw Clarabel vectors, residuals, status, objective value where applicable, per-objective terms, and linear-solver metadata.
Complete COPP2-SOCP Example
std::vector<double> s{0.0, 0.5, 1.0};
std::vector<double> amax{1.0, 1.0, 1.0};
robot.append_s(s);
robot.constraints().add_constraint_1st(amax, 0);
copp2::Problem problem{
robot,
};
auto expert = copp2::solve_expert(problem, options);
if (expert.a) {
}
Robot facade backed by Rust Robot<CppRobotModel>.
COPP_API TimeProfile s_to_t_topp2(Span< const double > s, Span< const double > a, double t0=0.0)
Convert a second-order path profile a(s) = ds/dt squared to t(s).
Second-order convex-objective Clarabel SOCP backend with normal profile-returning APIs and expert dia...
Second-order endpoint boundary values.
Closed station-index interval used by TOPP/COPP problem descriptors.
Tutorial Sources