robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
split_riccati_factorization.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_SPLIT_RICCATI_FACTORIZATION_HPP_
2#define ROBOTOC_SPLIT_RICCATI_FACTORIZATION_HPP_
3
4#include "Eigen/Core"
5
7
8
9namespace robotoc {
10
16public:
21 SplitRiccatiFactorization(const Robot& robot);
22
27
32
37
42 const SplitRiccatiFactorization&) = default;
43
48 SplitRiccatiFactorization&&) noexcept = default;
49
54 SplitRiccatiFactorization&&) noexcept = default;
55
60 Eigen::MatrixXd P;
61
65 Eigen::VectorXd s;
66
67 Eigen::Block<Eigen::MatrixXd> Pqq() {
68 return P.topLeftCorner(dimv_, dimv_);
69 }
70
71 const Eigen::Block<const Eigen::MatrixXd> Pqq() const {
72 return P.topLeftCorner(dimv_, dimv_);
73 }
74
75 Eigen::Block<Eigen::MatrixXd> Pqv() {
76 return P.topRightCorner(dimv_, dimv_);
77 }
78
79 const Eigen::Block<const Eigen::MatrixXd> Pqv() const {
80 return P.topRightCorner(dimv_, dimv_);
81 }
82
83 Eigen::Block<Eigen::MatrixXd> Pvq() {
84 return P.bottomLeftCorner(dimv_, dimv_);
85 }
86
87 const Eigen::Block<const Eigen::MatrixXd> Pvq() const {
88 return P.bottomLeftCorner(dimv_, dimv_);
89 }
90
91 Eigen::Block<Eigen::MatrixXd> Pvv() {
92 return P.bottomRightCorner(dimv_, dimv_);
93 }
94
95 const Eigen::Block<const Eigen::MatrixXd> Pvv() const {
96 return P.bottomRightCorner(dimv_, dimv_);
97 }
98
99 Eigen::VectorBlock<Eigen::VectorXd> sq() {
100 return s.head(dimv_);
101 }
102
103 const Eigen::VectorBlock<const Eigen::VectorXd> sq() const {
104 return s.head(dimv_);
105 }
106
107 Eigen::VectorBlock<Eigen::VectorXd> sv() {
108 return s.tail(dimv_);
109 }
110
111 const Eigen::VectorBlock<const Eigen::VectorXd> sv() const {
112 return s.tail(dimv_);
113 }
114
119 Eigen::VectorXd psi_x;
120
125 Eigen::VectorXd psi_u;
126
131 Eigen::VectorXd Psi;
132
137 Eigen::VectorXd phi_x;
138
143 Eigen::VectorXd phi_u;
144
149 Eigen::VectorXd Phi;
150
154 double xi;
155
159 double chi;
160
164 double rho;
165
169 double eta;
170
174 double iota;
175
176 void setConstraintDimension(const int dims=0);
177
178 int dims() const;
179
180 Eigen::Block<Eigen::MatrixXd> M();
181
182 const Eigen::Block<const Eigen::MatrixXd> M() const;
183
184 Eigen::VectorBlock<Eigen::VectorXd> m();
185
186 const Eigen::VectorBlock<const Eigen::VectorXd> m() const;
187
188 Eigen::VectorBlock<Eigen::VectorXd> mt();
189
190 const Eigen::VectorBlock<const Eigen::VectorXd> mt() const;
191
192 Eigen::VectorBlock<Eigen::VectorXd> mt_next();
193
194 const Eigen::VectorBlock<const Eigen::VectorXd> mt_next() const;
195
196 void setZero();
197
198 void setRandom();
199
205 bool isApprox(const SplitRiccatiFactorization& other) const;
206
211 bool hasNaN() const;
212
213 static SplitRiccatiFactorization Random(const Robot& robot);
214
218 void disp(std::ostream& os) const;
219
220 friend std::ostream& operator<<(std::ostream& os,
221 const SplitRiccatiFactorization& riccati);
222
223private:
224 Eigen::MatrixXd M_full_;
225 Eigen::VectorXd m_full_, mt_full_, mt_next_full_;
226 int dimv_, dimx_, dims_;
227};
228
229} // namespace robotoc
230
232
233#endif // ROBOTOC_SPLIT_RICCATI_FACTORIZATION_HPP_
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Riccati factorization matrix and vector for a time stage.
Definition: split_riccati_factorization.hpp:15
double iota
Riccati factorization w.r.t. the switching time.
Definition: split_riccati_factorization.hpp:174
double rho
Riccati factorization w.r.t. the switching time.
Definition: split_riccati_factorization.hpp:164
Eigen::Block< Eigen::MatrixXd > Pqq()
Definition: split_riccati_factorization.hpp:67
Eigen::Block< Eigen::MatrixXd > Pqv()
Definition: split_riccati_factorization.hpp:75
Eigen::VectorBlock< Eigen::VectorXd > sv()
Definition: split_riccati_factorization.hpp:107
int dims() const
Definition: split_riccati_factorization.hxx:68
Eigen::VectorXd psi_x
Riccati factorization vector w.r.t. the switching time. Size is 2 * Robot::dimv().
Definition: split_riccati_factorization.hpp:119
SplitRiccatiFactorization & operator=(const SplitRiccatiFactorization &)=default
Default copy operator.
const Eigen::Block< const Eigen::MatrixXd > Pvq() const
Definition: split_riccati_factorization.hpp:87
Eigen::VectorXd Phi
Riccati factorization vector w.r.t. the switching time. Size is 2 * Robot::dimv().
Definition: split_riccati_factorization.hpp:149
Eigen::VectorBlock< Eigen::VectorXd > mt()
Definition: split_riccati_factorization.hxx:93
void setRandom()
Definition: split_riccati_factorization.hxx:134
double chi
Riccati factorization w.r.t. the switching time.
Definition: split_riccati_factorization.hpp:159
Eigen::Block< Eigen::MatrixXd > M()
Definition: split_riccati_factorization.hxx:73
void disp(std::ostream &os) const
Displays the split Riccati factorization onto a ostream.
const Eigen::Block< const Eigen::MatrixXd > Pvv() const
Definition: split_riccati_factorization.hpp:95
bool hasNaN() const
Checks this object has at least one NaN.
Definition: split_riccati_factorization.hxx:180
void setConstraintDimension(const int dims=0)
Definition: split_riccati_factorization.hxx:61
const Eigen::VectorBlock< const Eigen::VectorXd > sq() const
Definition: split_riccati_factorization.hpp:103
Eigen::Block< Eigen::MatrixXd > Pvq()
Definition: split_riccati_factorization.hpp:83
const Eigen::Block< const Eigen::MatrixXd > Pqq() const
Definition: split_riccati_factorization.hpp:71
Eigen::VectorBlock< Eigen::VectorXd > sq()
Definition: split_riccati_factorization.hpp:99
Eigen::VectorBlock< Eigen::VectorXd > mt_next()
Definition: split_riccati_factorization.hxx:103
Eigen::VectorXd psi_u
Riccati factorization vector w.r.t. the switching time. Size is Robot::dimu().
Definition: split_riccati_factorization.hpp:125
~SplitRiccatiFactorization()
Destructor.
Definition: split_riccati_factorization.hxx:57
Eigen::VectorXd Psi
Riccati factorization vector w.r.t. the switching time. Size is 2 * Robot::dimv().
Definition: split_riccati_factorization.hpp:131
static SplitRiccatiFactorization Random(const Robot &robot)
Definition: split_riccati_factorization.hxx:202
Eigen::VectorBlock< Eigen::VectorXd > m()
Definition: split_riccati_factorization.hxx:83
Eigen::Block< Eigen::MatrixXd > Pvv()
Definition: split_riccati_factorization.hpp:91
Eigen::MatrixXd P
Riccati factorization matrix. Size is 2 * Robot::dimv() x 2 * Robot::dimv().
Definition: split_riccati_factorization.hpp:60
const Eigen::Block< const Eigen::MatrixXd > Pqv() const
Definition: split_riccati_factorization.hpp:79
bool isApprox(const SplitRiccatiFactorization &other) const
Checks the equivalence of two SplitRiccatiFactorization.
Definition: split_riccati_factorization.hxx:156
double xi
Riccati factorization w.r.t. the switching time.
Definition: split_riccati_factorization.hpp:154
SplitRiccatiFactorization(const SplitRiccatiFactorization &)=default
Default copy constructor.
Eigen::VectorXd phi_u
Riccati factorization vector w.r.t. the switching time. Size is Robot::dimu().
Definition: split_riccati_factorization.hpp:143
Eigen::VectorXd phi_x
Riccati factorization vector w.r.t. the switching time. Size is 2 * Robot::dimv().
Definition: split_riccati_factorization.hpp:137
Eigen::VectorXd s
Riccati factorization vector. Size is 2 * Robot::dimv().
Definition: split_riccati_factorization.hpp:65
SplitRiccatiFactorization(SplitRiccatiFactorization &&) noexcept=default
Default move constructor.
const Eigen::VectorBlock< const Eigen::VectorXd > sv() const
Definition: split_riccati_factorization.hpp:111
friend std::ostream & operator<<(std::ostream &os, const SplitRiccatiFactorization &riccati)
void setZero()
Definition: split_riccati_factorization.hxx:113
SplitRiccatiFactorization()
Default constructor.
Definition: split_riccati_factorization.hxx:33
double eta
Riccati factorization w.r.t. the switching time.
Definition: split_riccati_factorization.hpp:169
Definition: constraint_component_base.hpp:17