9 #ifndef CROCODDYL_CORE_SOLVERS_DDP_HPP_ 10 #define CROCODDYL_CORE_SOLVERS_DDP_HPP_ 12 #include <Eigen/Cholesky> 15 #include "crocoddyl/core/solver-base.hpp" 21 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
23 explicit SolverDDP(boost::shared_ptr<ShootingProblem> problem);
26 virtual bool solve(
const std::vector<Eigen::VectorXd>& init_xs = DEFAULT_VECTOR,
27 const std::vector<Eigen::VectorXd>& init_us = DEFAULT_VECTOR,
const std::size_t& maxiter = 100,
28 const bool& is_feasible =
false,
const double& regInit = 1e-9);
29 virtual void computeDirection(
const bool& recalc =
true);
30 virtual double tryStep(
const double& steplength = 1);
31 virtual double stoppingCriteria();
32 virtual const Eigen::Vector2d& expectedImprovement();
33 virtual double calcDiff();
34 virtual void backwardPass();
35 virtual void forwardPass(
const double& stepLength);
37 virtual void computeGains(
const std::size_t& t);
38 void increaseRegularization();
39 void decreaseRegularization();
40 virtual void allocateData();
42 const double& get_regfactor()
const;
43 const double& get_regmin()
const;
44 const double& get_regmax()
const;
45 const std::vector<double>& get_alphas()
const;
46 const double& get_th_stepdec()
const;
47 const double& get_th_stepinc()
const;
48 const double& get_th_grad()
const;
49 const std::vector<Eigen::MatrixXd>& get_Vxx()
const;
50 const std::vector<Eigen::VectorXd>& get_Vx()
const;
51 const std::vector<Eigen::MatrixXd>& get_Qxx()
const;
52 const std::vector<Eigen::MatrixXd>& get_Qxu()
const;
53 const std::vector<Eigen::MatrixXd>& get_Quu()
const;
54 const std::vector<Eigen::VectorXd>& get_Qx()
const;
55 const std::vector<Eigen::VectorXd>& get_Qu()
const;
56 const std::vector<Eigen::MatrixXd>& get_K()
const;
57 const std::vector<Eigen::VectorXd>& get_k()
const;
58 const std::vector<Eigen::VectorXd>& get_fs()
const;
60 void set_regfactor(
const double& reg_factor);
61 void set_regmin(
const double& regmin);
62 void set_regmax(
const double& regmax);
63 void set_alphas(
const std::vector<double>& alphas);
64 void set_th_stepdec(
const double& th_step);
65 void set_th_stepinc(
const double& th_step);
66 void set_th_grad(
const double& th_grad);
76 std::vector<Eigen::VectorXd> dx_;
79 std::vector<Eigen::MatrixXd>
Vxx_;
80 std::vector<Eigen::VectorXd>
Vx_;
81 std::vector<Eigen::MatrixXd>
Qxx_;
82 std::vector<Eigen::MatrixXd>
Qxu_;
83 std::vector<Eigen::MatrixXd>
Quu_;
84 std::vector<Eigen::VectorXd>
Qx_;
85 std::vector<Eigen::VectorXd>
Qu_;
86 std::vector<Eigen::MatrixXd>
K_;
87 std::vector<Eigen::VectorXd>
k_;
88 std::vector<Eigen::VectorXd>
fs_;
90 Eigen::VectorXd xnext_;
91 Eigen::MatrixXd FxTVxx_p_;
92 std::vector<Eigen::MatrixXd> FuTVxx_p_;
93 Eigen::VectorXd fTVxx_p_;
94 std::vector<Eigen::LLT<Eigen::MatrixXd> > Quu_llt_;
95 std::vector<Eigen::VectorXd> Quuk_;
105 #endif // CROCODDYL_CORE_SOLVERS_DDP_HPP_ std::vector< Eigen::VectorXd > fs_
Gaps/defects between shooting nodes.
std::vector< Eigen::VectorXd > xs_try_
State trajectory computed by line-search procedure.
double th_stepdec_
Step-length threshold used to decrease regularization.
std::vector< Eigen::VectorXd > k_
Feed-forward terms.
std::vector< Eigen::VectorXd > Vx_
Gradient of the Value function.
std::vector< Eigen::MatrixXd > Qxx_
Hessian of the Hamiltonian.
std::vector< Eigen::MatrixXd > K_
Feedback gains.
std::vector< Eigen::MatrixXd > Vxx_
Hessian of the Value function.
double th_stepinc_
Step-length threshold used to increase regularization.
bool was_feasible_
Label that indicates in the previous iterate was feasible.
double th_grad_
Tolerance of the expected gradient used for testing the step.
std::vector< double > alphas_
Set of step lengths using by the line-search procedure.
std::vector< Eigen::VectorXd > Qx_
Gradient of the Hamiltonian.
double regmin_
Minimum allowed regularization value.
double regmax_
Maximum allowed regularization value.
double regfactor_
Regularization factor used to decrease / increase it.
std::vector< Eigen::MatrixXd > Qxu_
Hessian of the Hamiltonian.
std::vector< Eigen::VectorXd > us_try_
Control trajectory computed by line-search procedure.
std::vector< Eigen::MatrixXd > Quu_
Hessian of the Hamiltonian.
std::vector< Eigen::VectorXd > Qu_
Gradient of the Hamiltonian.
double cost_try_
Total cost computed by line-search procedure.