robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
sto_policy.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_STO_POLICY_HPP_
2#define ROBOTOC_STO_POLICY_HPP_
3
4#include "Eigen/Core"
5
7
8
9namespace robotoc {
10
16class STOPolicy {
17public:
22 STOPolicy(const Robot& robot)
23 : dtsdx(Eigen::VectorXd::Zero(2*robot.dimv())),
24 dtsdts(0),
25 dts0(0) {
26 }
27
32 : dtsdx(),
33 dtsdts(0),
34 dts0(0) {
35 }
36
41 }
42
46 STOPolicy(const STOPolicy&) = default;
47
51 STOPolicy& operator=(const STOPolicy&) = default;
52
56 STOPolicy(STOPolicy&&) noexcept = default;
57
61 STOPolicy& operator=(STOPolicy&&) noexcept = default;
62
67 Eigen::VectorXd dtsdx;
68
73 double dtsdts;
74
78 double dts0;
79
85 bool isApprox(const STOPolicy& other) const {
86 if (!dtsdx.isApprox(other.dtsdx)) return false;
87 Eigen::Vector2d vec, vec_other;
88 vec << dtsdts, dts0;
89 vec_other << other.dtsdts, other.dts0;
90 if (!vec.isApprox(vec_other)) return false;
91 return true;
92 }
93
94private:
95
96};
97
98} // namespace robotoc
99
100#endif // ROBOTOC_STO_POLICY_HPP_
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
The state feedback and feedforward policy of the switching time optimization (STO).
Definition: sto_policy.hpp:16
STOPolicy & operator=(const STOPolicy &)=default
Default copy operator.
bool isApprox(const STOPolicy &other) const
Checks the equivalence of two STOPolicy.
Definition: sto_policy.hpp:85
STOPolicy(STOPolicy &&) noexcept=default
Default move constructor.
STOPolicy(const STOPolicy &)=default
Default copy constructor.
STOPolicy()
Default constructor.
Definition: sto_policy.hpp:31
double dts0
Feedforward term of the STO policy.
Definition: sto_policy.hpp:78
Eigen::VectorXd dtsdx
Feedback gain of the STO policy, i.e. the sensitivity w.r.t. the state. Size is 2 * Robot::dimv().
Definition: sto_policy.hpp:67
double dtsdts
Feedback gain of the STO policy, i.e. the sensitivity w.r.t. the previous switching time.
Definition: sto_policy.hpp:73
~STOPolicy()
Destructor.
Definition: sto_policy.hpp:40
STOPolicy(const Robot &robot)
Constructs STO gain and feedforward term.
Definition: sto_policy.hpp:22
Definition: constraint_component_base.hpp:17