9#ifndef CROCODDYL_CORE_SOLVERS_INTRO_HPP_
10#define CROCODDYL_CORE_SOLVERS_INTRO_HPP_
12#include "crocoddyl/core/solvers/fddp.hpp"
16enum EqualitySolverType { LuNull = 0, QrNull, Schur };
20 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
29 explicit SolverIntro(std::shared_ptr<ShootingProblem> problem);
33 const std::vector<Eigen::VectorXd>& init_xs = DEFAULT_VECTOR,
34 const std::vector<Eigen::VectorXd>& init_us = DEFAULT_VECTOR,
35 const std::size_t maxiter = 100,
const bool is_feasible =
false,
36 const double init_reg = NAN);
37 virtual double tryStep(
const double step_length = 1);
38 virtual double stoppingCriteria();
39 virtual void resizeData();
40 virtual double calcDiff();
41 virtual void computeValueFunction(
42 const std::size_t t,
const std::shared_ptr<ActionModelAbstract>& model);
43 virtual void computeGains(
const std::size_t t);
69 const std::vector<std::size_t>& get_Hu_rank()
const;
75 const std::vector<Eigen::MatrixXd>&
get_YZ()
const;
80 const std::vector<Eigen::MatrixXd>&
get_Qzz()
const;
85 const std::vector<Eigen::MatrixXd>&
get_Qxz()
const;
90 const std::vector<Eigen::MatrixXd>&
get_Quz()
const;
95 const std::vector<Eigen::VectorXd>&
get_Qz()
const;
101 const std::vector<Eigen::MatrixXd>&
get_Hy()
const;
107 const std::vector<Eigen::VectorXd>&
get_kz()
const;
112 const std::vector<Eigen::MatrixXd>&
get_Kz()
const;
117 const std::vector<Eigen::VectorXd>&
get_ks()
const;
122 const std::vector<Eigen::MatrixXd>&
get_Ks()
const;
149 void set_rho(
const double rho);
160 enum EqualitySolverType
171 std::vector<std::size_t>
173 std::vector<Eigen::MatrixXd> KQuu_tmp_;
174 std::vector<Eigen::MatrixXd>
178 std::vector<Eigen::MatrixXd>
181 std::vector<Eigen::VectorXd>
183 std::vector<Eigen::MatrixXd>
185 std::vector<Eigen::MatrixXd>
187 std::vector<Eigen::MatrixXd>
189 std::vector<Eigen::VectorXd>
191 std::vector<Eigen::MatrixXd>
193 std::vector<Eigen::VectorXd>
195 std::vector<Eigen::MatrixXd>
197 std::vector<Eigen::MatrixXd> QuuinvHuT_;
198 std::vector<Eigen::LLT<Eigen::MatrixXd> >
Qzz_llt_;
199 std::vector<Eigen::FullPivLU<Eigen::MatrixXd> >
202 std::vector<Eigen::ColPivHouseholderQR<Eigen::MatrixXd> >
205 std::vector<Eigen::PartialPivLU<Eigen::MatrixXd> >
Feasibility-driven Differential Dynamic Programming (FDDP) solver.
std::vector< Eigen::MatrixXd > Kz_
Feedback gain in the nullspace of .
std::vector< Eigen::FullPivLU< Eigen::MatrixXd > > Hu_lu_
std::vector< Eigen::MatrixXd > Hy_
double th_feas_
Threshold for switching to feasibility.
std::vector< std::size_t > Hu_rank_
Rank of the control Jacobian of the equality constraints.
std::vector< Eigen::MatrixXd > Qxz_
Hessian of the reduced Hamiltonian .
std::vector< Eigen::VectorXd > Qz_
Jacobian of the reduced Hamiltonian .
double get_th_feas() const
Return the threshold for switching to feasibility.
const std::vector< Eigen::VectorXd > & get_kz() const
Return feedforward term related to the nullspace of .
EqualitySolverType get_equality_solver() const
Return the type of solver used for handling the equality constraints.
const std::vector< Eigen::MatrixXd > & get_YZ() const
Return the rank of control-equality constraints \mathbf{H_u}\f.
const std::vector< Eigen::MatrixXd > & get_Kz() const
Return feedback gain related to the nullspace of .
void set_equality_solver(const EqualitySolverType type)
Modify the type of solver used for handling the equality constraints.
std::vector< Eigen::MatrixXd > Quz_
Hessian of the reduced Hamiltonian .
std::vector< Eigen::MatrixXd > Ks_
Feedback gain related to the equality constraints.
std::vector< Eigen::LLT< Eigen::MatrixXd > > Qzz_llt_
Cholesky LLT solver.
std::vector< Eigen::ColPivHouseholderQR< Eigen::MatrixXd > > Hu_qr_
std::vector< Eigen::MatrixXd > Qzz_
Hessian of the reduced Hamiltonian .
void set_zero_upsilon(const bool zero_upsilon)
Modify the zero-upsilon label.
const std::vector< Eigen::MatrixXd > & get_Hy() const
Return span-projected Jacobian of the equality-constraint with respect to the control.
double get_rho() const
Return the rho parameter used in the merit function.
const std::vector< Eigen::MatrixXd > & get_Qxz() const
Return Hessian of the reduced Hamiltonian .
const std::vector< Eigen::MatrixXd > & get_Ks() const
Return feedback gain related to the equality constraints.
void set_th_feas(const double th_feas)
Modify the threshold for switching to feasibility.
bool get_zero_upsilon() const
Return the zero-upsilon label.
double get_upsilon() const
Return the estimated penalty parameter that balances relative contribution of the cost function and e...
std::vector< Eigen::MatrixXd > YZ_
const std::vector< Eigen::MatrixXd > & get_Quz() const
Return Hessian of the reduced Hamiltonian .
enum EqualitySolverType eq_solver_
Strategy used for handling the equality constraints.
const std::vector< Eigen::MatrixXd > & get_Qzz() const
Return Hessian of the reduced Hamiltonian .
std::vector< Eigen::VectorXd > kz_
Feedforward term in the nullspace of .
const std::vector< Eigen::VectorXd > & get_ks() const
Return feedforward term related to the equality constraints.
const std::vector< Eigen::VectorXd > & get_Qz() const
Return Jacobian of the reduced Hamiltonian .
std::vector< Eigen::PartialPivLU< Eigen::MatrixXd > > Hy_lu_
std::vector< Eigen::VectorXd > ks_
Feedforward term related to the equality constraints.
void set_rho(const double rho)
Modify the rho parameter used in the merit function.