1#ifndef ROBOTOC_SPLIT_RICCATI_FACTORIZATION_HXX_
2#define ROBOTOC_SPLIT_RICCATI_FACTORIZATION_HXX_
10 : P(Eigen::MatrixXd::
Zero(2*robot.dimv(), 2*robot.dimv())),
11 s(Eigen::VectorXd::
Zero(2*robot.dimv())),
12 psi_x(Eigen::VectorXd::
Zero(2*robot.dimv())),
13 psi_u(Eigen::VectorXd::
Zero(robot.dimu())),
14 Psi(Eigen::VectorXd::
Zero(2*robot.dimv())),
15 phi_x(Eigen::VectorXd::
Zero(2*robot.dimv())),
16 phi_u(Eigen::VectorXd::
Zero(robot.dimu())),
17 Phi(Eigen::VectorXd::
Zero(2*robot.dimv())),
23 M_full_(Eigen::MatrixXd::
Zero(robot.max_dimf(), 2*robot.dimv())),
24 m_full_(Eigen::VectorXd::
Zero(robot.max_dimf())),
25 mt_full_(Eigen::VectorXd::
Zero(robot.max_dimf())),
26 mt_next_full_(Eigen::VectorXd::
Zero(robot.max_dimf())),
28 dimx_(2*robot.dimv()),
63 assert(
dims <= m_full_.size());
74 return M_full_.topLeftCorner(dims_, dimx_);
79 return M_full_.topLeftCorner(dims_, dimx_);
84 return m_full_.head(dims_);
89 return m_full_.head(dims_);
94 return mt_full_.head(dims_);
99 return mt_full_.head(dims_);
104 return mt_next_full_.head(dims_);
109 return mt_next_full_.head(dims_);
130 mt_next_full_.setZero();
143 const Eigen::VectorXd vec = Eigen::VectorXd::Random(5);
151 mt_full_.setRandom();
152 mt_next_full_.setRandom();
158 if (!
P.isApprox(other.
P))
return false;
159 if (!
s.isApprox(other.
s))
return false;
160 if (!
psi_x.isApprox(other.
psi_x))
return false;
161 if (!
psi_u.isApprox(other.
psi_u))
return false;
162 if (!
Psi.isApprox(other.
Psi))
return false;
163 if (!
phi_x.isApprox(other.
phi_x))
return false;
164 if (!
phi_u.isApprox(other.
phi_u))
return false;
165 if (!
Phi.isApprox(other.
Phi))
return false;
166 Eigen::VectorXd vec(5), other_vec(5);
169 if (!vec.isApprox(other_vec))
return false;
181 if (
P.hasNaN())
return true;
182 if (
s.hasNaN())
return true;
183 if (
psi_x.hasNaN())
return true;
184 if (
psi_u.hasNaN())
return true;
185 if (
Psi.hasNaN())
return true;
186 if (
phi_x.hasNaN())
return true;
187 if (
phi_u.hasNaN())
return true;
188 if (
Phi.hasNaN())
return true;
189 Eigen::VectorXd vec(5);
191 if (vec.hasNaN())
return true;
203 const Robot& robot) {
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
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
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
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
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::MatrixXd P
Riccati factorization matrix. Size is 2 * Robot::dimv() x 2 * Robot::dimv().
Definition: split_riccati_factorization.hpp:60
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
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
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