27 for (std::size_t i = 0; i < tau.
size(); ++i)
38 std::vector<double> s{0.0, 0.25, 0.5, 0.75, 1.0};
39 std::vector<double> upper{3.0, 3.0};
40 std::vector<double> lower{-3.0, -3.0};
41 std::vector<double> torque_upper{50.0, 50.0};
42 std::vector<double> torque_lower{-50.0, -50.0};
48 return std::vector<copp::Jet3>{
68 dynamics(q, dq, ddq, tau);
82 copp2::Problem problem{
93 auto expert = copp2::solve_expert(problem);
96 std::cerr <<
"Clarabel did not return an accepted profile\n";
102 std::cout <<
"accepted a length = " << expert.a->size() <<
"\n";
103 std::cout <<
"t_final = " << time.t_final <<
"\n";
104 std::cout <<
"objective = " << *expert.objective_value <<
"\n";
static Path from_parametric(PathParametric parametric, double s_min, double s_max)
Build a path from a scalar-parametric formula.
Robot facade backed by Rust Robot<CppRobotModel>.
Robot & add_torque_limits(Span< const double > upper, Span< const double > lower, std::size_t start_idx_s, std::size_t length=0)
Add torque limits from broadcast vectors.
Robot & set_q_from_path_2nd(const Path &path, std::size_t idx_s_from, std::size_t idx_s_to)
Sample a path and store derivatives up to second order.
Robot & add_acceleration_limits(Span< const double > upper, Span< const double > lower, std::size_t start_idx_s, std::size_t length=0)
Add acceleration limits from broadcast vectors.
bool has_inverse_dynamics() const
Return whether a user inverse-dynamics callback is installed.
Robot & append_s(Span< const double > s)
Append strictly increasing path station samples.
Robot & add_velocity_limits(Span< const double > upper, Span< const double > lower, std::size_t start_idx_s, std::size_t length=0)
Add velocity limits from broadcast vectors.
Robot & set_inverse_dynamics(InverseDynamics inverse_dynamics)
Replace the inverse-dynamics callback.
Non-owning view of a contiguous one-dimensional array.
constexpr std::size_t size() const noexcept
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).
Objective ThermalEnergy(double weight, Span< const double > normalize)
Objective Time(double weight=1.0)
Second-order convex-objective Clarabel SOCP backend with normal profile-returning APIs and expert dia...
Jet3 sin(Jet3 x) noexcept
void operator()(copp::Span< const double > q, copp::Span< const double > dq, copp::Span< const double > ddq, copp::Span< double > tau) const
std::vector< double > damping
std::vector< double > inertia
std::vector< double > gravity
Second-order endpoint boundary values.
Closed station-index interval used by TOPP/COPP problem descriptors.
Third-order forward-mode automatic-differentiation scalar.