COPP C++ API
C++ interface for COPP trajectory optimization
Loading...
Searching...
No Matches
copp3_socp.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <initializer_list>
4#include <vector>
5
6#include "copp/clarabel.hpp"
8#include "copp/objective.hpp"
9#include "copp/robot.hpp"
10#include "copp/solver/topp3.hpp"
11
13{
14
17
36 {
37 public:
39 Robot &robot,
40 std::vector<Objective> objectives,
42 std::size_t idx_s_start = 0,
44 StationaryBounds num_stationary_max = {},
45 double a_linearization_floor = 1.0e-10);
46
48 Robot &robot,
49 std::initializer_list<Objective> objectives,
51 std::size_t idx_s_start = 0,
53 StationaryBounds num_stationary_max = {},
54 double a_linearization_floor = 1.0e-10);
55
57 Robot &robot,
58 std::vector<Objective> objectives,
60 std::size_t idx_s_start,
62 std::size_t symmetric_num_stationary_max,
63 double a_linearization_floor = 1.0e-10);
64
65 Robot &robot() const noexcept { return *robot_; }
66 const std::vector<Objective> &objectives() const noexcept { return objectives_; }
67 const std::vector<double> &a_linearization() const noexcept { return a_linearization_; }
68 std::size_t idx_s_start() const noexcept { return idx_s_start_; }
69 std::size_t idx_s_final() const noexcept { return idx_s_final_; }
70 Boundary3 boundary() const noexcept { return boundary_; }
71 StationaryBounds num_stationary_max() const noexcept { return num_stationary_max_; }
72 StationaryBounds num_stationary() const noexcept { return num_stationary_; }
73 double a_linearization_floor() const noexcept { return a_linearization_floor_; }
74 std::size_t s_len() const noexcept { return a_linearization_.size(); }
75
76 private:
77 Robot *robot_ = nullptr;
78 std::vector<Objective> objectives_;
79 std::vector<double> a_linearization_;
80 std::size_t idx_s_start_ = 0;
81 std::size_t idx_s_final_ = 0;
82 Boundary3 boundary_;
83 StationaryBounds num_stationary_max_;
84 StationaryBounds num_stationary_;
85 double a_linearization_floor_ = 1.0e-10;
86 };
87
92 COPP_API Profile3rd solve(const Problem &problem, const clarabel::Options &options = {});
94 const Problem &problem,
95 const clarabel::Options &options,
97 {
98 return detail::expected_from([&] { return solve(problem, options); });
99 }
100 inline Expected<Profile3rd> solve(const Problem &problem, NoThrowTag tag)
101 {
102 return solve(problem, clarabel::Options{}, tag);
103 }
104
109 COPP_API Result solve_expert(const Problem &problem, const clarabel::Options &options = {});
111 const Problem &problem,
112 const clarabel::Options &options,
114 {
115 return detail::expected_from([&] { return solve_expert(problem, options); });
116 }
118 {
119 return solve_expert(problem, clarabel::Options{}, tag);
120 }
121
122} // namespace copp::solver::copp3_socp
Small C++17 expected-like result used by no-throw overloads.
Definition core.hpp:527
Robot facade backed by Rust Robot<CppRobotModel>.
Definition robot.hpp:318
Non-owning view of a contiguous one-dimensional array.
Definition core.hpp:139
COPP3-SOCP problem descriptor.
StationaryBounds num_stationary_max() const noexcept
std::size_t idx_s_start() const noexcept
Problem(Robot &robot, std::initializer_list< Objective > objectives, 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)
const std::vector< double > & a_linearization() const noexcept
const std::vector< Objective > & objectives() const noexcept
Robot & robot() const noexcept
std::size_t s_len() const noexcept
Problem(Robot &robot, std::vector< Objective > objectives, 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)
Problem(Robot &robot, std::vector< Objective > objectives, 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)
double a_linearization_floor() const noexcept
std::size_t idx_s_final() const noexcept
Boundary3 boundary() const noexcept
StationaryBounds num_stationary() const noexcept
#define COPP_API
Definition core.hpp:23
auto expected_from(Fn &&fn) -> Expected< typename std::decay< decltype(fn())>::type >
Definition core.hpp:580
Third-order convex-objective Clarabel SOCP backend with COPP objective support and expert objective/s...
COPP_API Result solve_expert(const Problem &problem, const clarabel::Options &options={})
Solve COPP3-SOCP and always return Clarabel diagnostics.
copp::solver::topp3::Result Result
copp::solver::topp3::StationaryBounds StationaryBounds
COPP_API Profile3rd solve(const Problem &problem, const clarabel::Options &options={})
Solve COPP3-SOCP and return an accepted third-order profile.
Third-order endpoint boundary values.
Definition core.hpp:87
Tag object selecting no-throw overloads.
Definition core.hpp:608
Owned third-order TOPP/COPP profile.
Shared Clarabel options for COPP/TOPP SOCP-style solvers.
Definition clarabel.hpp:117
Expert third-order Clarabel result.
Definition topp3.hpp:105
User-supplied upper bound for stationary boundary intervals.
Definition topp3.hpp:25