robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
split_constrained_riccati_factorization.hxx
Go to the documentation of this file.
1#ifndef ROBOTOC_SPLIT_CONSTRAINTED_RICCATI_FACTORIZATION_HXX_
2#define ROBOTOC_SPLIT_CONSTRAINTED_RICCATI_FACTORIZATION_HXX_
3
5
6#include <cassert>
7
8namespace robotoc {
9
12 : Ginv(Eigen::MatrixXd::Zero(robot.dimu(), robot.dimu())),
13 DtM(Eigen::MatrixXd::Zero(robot.dimu(), robot.dimu())),
14 KtDtM(Eigen::MatrixXd::Zero(2*robot.dimv(), 2*robot.dimv())),
15 DGinv_full_(Eigen::MatrixXd::Zero(robot.max_dimf(), robot.dimu())),
16 S_full_(Eigen::MatrixXd::Zero(robot.max_dimf(), robot.max_dimf())),
17 Sinv_full_(Eigen::MatrixXd::Zero(robot.max_dimf(), robot.max_dimf())),
18 SinvDGinv_full_(Eigen::MatrixXd::Zero(robot.max_dimf(), robot.dimu())),
19 dimv_(robot.dimv()),
20 dimx_(2*robot.dimv()),
21 dimu_(robot.dimu()),
22 dims_(0) {
23}
24
25
28 : Ginv(),
29 DtM(),
30 KtDtM(),
31 DGinv_full_(),
32 S_full_(),
33 Sinv_full_(),
34 SinvDGinv_full_(),
35 dimv_(0),
36 dimx_(0),
37 dimu_(0),
38 dims_(0) {
39}
40
41
44}
45
46
48 const int dimi) {
49 dims_ = dimi;
50}
51
52
54 return dims_;
55}
56
57
58inline Eigen::Block<Eigen::MatrixXd>
60 return DGinv_full_.topLeftCorner(dims_, dimu_);
61}
62
63
64inline const Eigen::Block<const Eigen::MatrixXd>
66 return DGinv_full_.topLeftCorner(dims_, dimu_);
67}
68
69
70inline Eigen::Block<Eigen::MatrixXd>
72 return S_full_.topLeftCorner(dims_, dims_);
73}
74
75
76inline const Eigen::Block<const Eigen::MatrixXd>
78 return S_full_.topLeftCorner(dims_, dims_);
79}
80
81
82inline Eigen::Block<Eigen::MatrixXd>
84 return Sinv_full_.topLeftCorner(dims_, dims_);
85}
86
87
88inline const Eigen::Block<const Eigen::MatrixXd>
90 return Sinv_full_.topLeftCorner(dims_, dims_);
91}
92
93
94inline Eigen::Block<Eigen::MatrixXd>
96 return SinvDGinv_full_.topLeftCorner(dims_, dimu_);
97}
98
99
100inline const Eigen::Block<const Eigen::MatrixXd>
102 return SinvDGinv_full_.topLeftCorner(dims_, dimu_);
103}
104
105
107 const SplitConstrainedRiccatiFactorization& other) const {
108 if (dims() != other.dims()) return false;
109 if (!DGinv().isApprox(other.DGinv())) return false;
110 if (!S().isApprox(other.S())) return false;
111 if (!Sinv().isApprox(other.Sinv())) return false;
112 if (!SinvDGinv().isApprox(other.SinvDGinv())) return false;
113 if (!Ginv.isApprox(other.Ginv)) return false;
114 if (!DtM.isApprox(other.DtM)) return false;
115 if (!KtDtM.isApprox(other.KtDtM)) return false;
116 return true;
117}
118
119
121 if (DGinv().hasNaN()) return true;
122 if (S().hasNaN()) return true;
123 if (Sinv().hasNaN()) return true;
124 if (SinvDGinv().hasNaN()) return true;
125 if (Ginv.hasNaN()) return true;
126 if (DtM.hasNaN()) return true;
127 if (KtDtM.hasNaN()) return true;
128 return false;
129}
130
131} // namespace robotoc
132
133#endif // ROBOTOC_SPLIT_CONSTRAINTED_RICCATI_FACTORIZATION_HXX_
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Riccati factorization matrix and vector for the switching constraint.
Definition: split_constrained_riccati_factorization.hpp:17
Eigen::Block< Eigen::MatrixXd > SinvDGinv()
Definition: split_constrained_riccati_factorization.hxx:95
SplitConstrainedRiccatiFactorization()
Default constructor.
Definition: split_constrained_riccati_factorization.hxx:27
Eigen::Block< Eigen::MatrixXd > S()
Definition: split_constrained_riccati_factorization.hxx:71
void setConstraintDimension(const int dimi=0)
Definition: split_constrained_riccati_factorization.hxx:47
Eigen::Block< Eigen::MatrixXd > Sinv()
Definition: split_constrained_riccati_factorization.hxx:83
Eigen::MatrixXd KtDtM
Definition: split_constrained_riccati_factorization.hpp:84
~SplitConstrainedRiccatiFactorization()
Destructor.
Definition: split_constrained_riccati_factorization.hxx:43
bool hasNaN() const
Definition: split_constrained_riccati_factorization.hxx:120
int dims() const
Definition: split_constrained_riccati_factorization.hxx:53
Eigen::MatrixXd DtM
Definition: split_constrained_riccati_factorization.hpp:82
bool isApprox(const SplitConstrainedRiccatiFactorization &other) const
Definition: split_constrained_riccati_factorization.hxx:106
Eigen::MatrixXd Ginv
Definition: split_constrained_riccati_factorization.hpp:80
Eigen::Block< Eigen::MatrixXd > DGinv()
Definition: split_constrained_riccati_factorization.hxx:59
Definition: constraint_component_base.hpp:17