11 #ifndef CROCODDYL_CORE_SOLVERS_KKT_HPP_
12 #define CROCODDYL_CORE_SOLVERS_KKT_HPP_
14 #include <Eigen/Cholesky>
15 #include <Eigen/Dense>
17 #include "crocoddyl/core/solver-base.hpp"
23 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
25 explicit SolverKKT(boost::shared_ptr<ShootingProblem> problem);
29 const std::vector<Eigen::VectorXd>& init_xs = DEFAULT_VECTOR,
30 const std::vector<Eigen::VectorXd>& init_us = DEFAULT_VECTOR,
31 const std::size_t maxiter = 100,
const bool is_feasible =
false,
32 const double regInit = 1e-9);
34 virtual double tryStep(
const double steplength = 1);
38 const Eigen::MatrixXd& get_kkt()
const;
39 const Eigen::VectorXd& get_kktref()
const;
40 const Eigen::VectorXd& get_primaldual()
const;
41 const std::vector<Eigen::VectorXd>& get_dxs()
const;
42 const std::vector<Eigen::VectorXd>& get_dus()
const;
43 const std::vector<Eigen::VectorXd>& get_lambdas()
const;
44 std::size_t get_nx()
const;
45 std::size_t get_ndx()
const;
46 std::size_t get_nu()
const;
49 double reg_incfactor_;
50 double reg_decfactor_;
54 std::vector<Eigen::VectorXd> xs_try_;
55 std::vector<Eigen::VectorXd> us_try_;
59 void computePrimalDual();
60 void increaseRegularization();
61 void decreaseRegularization();
67 std::vector<Eigen::VectorXd> dxs_;
68 std::vector<Eigen::VectorXd> dus_;
69 std::vector<Eigen::VectorXd> lambdas_;
73 Eigen::VectorXd kktref_;
74 Eigen::VectorXd primaldual_;
75 Eigen::VectorXd primal_;
76 Eigen::VectorXd dual_;
77 std::vector<double> alphas_;
80 Eigen::VectorXd kkt_primal_;
Abstract class for optimal control solvers.
virtual bool solve(const std::vector< Eigen::VectorXd > &init_xs=DEFAULT_VECTOR, const std::vector< Eigen::VectorXd > &init_us=DEFAULT_VECTOR, const std::size_t maxiter=100, const bool is_feasible=false, const double regInit=1e-9)
Compute the optimal trajectory as lists of and terms.
virtual double tryStep(const double steplength=1)
Try a predefined step length and compute its cost improvement .
virtual const Eigen::Vector2d & expectedImprovement()
Return the expected improvement from a given current search direction .
virtual double stoppingCriteria()
Return a positive value that quantifies the algorithm termination.
virtual void computeDirection(const bool recalc=true)
Compute the search direction for the current guess .