robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
ocp.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_OCP_HPP_
2#define ROBOTOC_OCP_HPP_
3
4#include <vector>
5#include <memory>
6#include <cassert>
7
14
15
16namespace robotoc {
17
22struct OCP {
37 OCP(const Robot& robot, const std::shared_ptr<CostFunction>& cost,
38 const std::shared_ptr<Constraints>& constraints,
39 const std::shared_ptr<STOCostFunction>& sto_cost,
40 const std::shared_ptr<STOConstraints>& sto_constraints,
41 const std::shared_ptr<ContactSequence>& contact_sequence,
42 const double T, const int N, const int reserved_num_discrete_events=0);
43
56 OCP(const Robot& robot, const std::shared_ptr<CostFunction>& cost,
57 const std::shared_ptr<Constraints>& constraints,
58 const std::shared_ptr<ContactSequence>& contact_sequence,
59 const double T, const int N, const int reserved_num_discrete_events=0);
60
70 OCP(const Robot& robot, const std::shared_ptr<CostFunction>& cost,
71 const std::shared_ptr<Constraints>& constraints,
72 const double T, const int N);
73
77 OCP();
78
82 ~OCP() = default;
83
87 OCP(const OCP&) = default;
88
92 OCP& operator=(const OCP&) = default;
93
97 OCP(OCP&&) noexcept = default;
98
102 OCP& operator=(OCP&&) noexcept = default;
103
108
112 std::shared_ptr<CostFunction> cost = nullptr;
113
117 std::shared_ptr<Constraints> constraints = nullptr;
118
122 std::shared_ptr<STOCostFunction> sto_cost= nullptr;
123
127 std::shared_ptr<STOConstraints> sto_constraints = nullptr;
128
132 std::shared_ptr<ContactSequence> contact_sequence = nullptr;
133
137 double T = 0.0;
138
142 int N = 0;
143
148
149 void disp(std::ostream& os) const;
150
151 friend std::ostream& operator<<(std::ostream& os, const OCP& ocp);
152};
153
154} // namespace robotoc
155
156#endif // ROBOTOC_OCP_HPP_
Stack of the inequality constraints. Composed by constraint components that inherits ConstraintCompon...
Definition: constraints.hpp:30
The sequence of contact status and discrete events (impact and lift).
Definition: contact_sequence.hpp:23
Stack of the cost function. Composed by cost function components that inherits CostFunctionComponentB...
Definition: cost_function.hpp:30
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Constraints of the switching time optimization problems.
Definition: sto_constraints.hpp:23
Stack of the cost function of the switching time optimization (STO) problem. Composed by cost functio...
Definition: sto_cost_function.hpp:24
Definition: constraint_component_base.hpp:17
The optimal control problem.
Definition: ocp.hpp:22
int N
Definition: ocp.hpp:142
OCP(const Robot &robot, const std::shared_ptr< CostFunction > &cost, const std::shared_ptr< Constraints > &constraints, const std::shared_ptr< ContactSequence > &contact_sequence, const double T, const int N, const int reserved_num_discrete_events=0)
Construct the optiaml control problem.
OCP(OCP &&) noexcept=default
Default move constructor.
std::shared_ptr< STOCostFunction > sto_cost
The STO cost function.
Definition: ocp.hpp:122
int reserved_num_discrete_events
Definition: ocp.hpp:147
std::shared_ptr< Constraints > constraints
The constraints.
Definition: ocp.hpp:117
std::shared_ptr< ContactSequence > contact_sequence
Definition: ocp.hpp:132
OCP(const OCP &)=default
Default copy constructor.
~OCP()=default
Default destructor.
OCP(const Robot &robot, const std::shared_ptr< CostFunction > &cost, const std::shared_ptr< Constraints > &constraints, const std::shared_ptr< STOCostFunction > &sto_cost, const std::shared_ptr< STOConstraints > &sto_constraints, const std::shared_ptr< ContactSequence > &contact_sequence, const double T, const int N, const int reserved_num_discrete_events=0)
Construct the optiaml control problem.
OCP & operator=(const OCP &)=default
Default copy assign operator.
std::shared_ptr< STOConstraints > sto_constraints
The STO constraints.
Definition: ocp.hpp:127
void disp(std::ostream &os) const
OCP()
Default constructor.
Robot robot
The robot model.
Definition: ocp.hpp:107
std::shared_ptr< CostFunction > cost
The cost function.
Definition: ocp.hpp:112
OCP(const Robot &robot, const std::shared_ptr< CostFunction > &cost, const std::shared_ptr< Constraints > &constraints, const double T, const int N)
Construct the optiaml control problem.
double T
Definition: ocp.hpp:137