11 #ifndef CROCODDYL_CORE_SOLVERS_KKT_HPP_
12 #define CROCODDYL_CORE_SOLVERS_KKT_HPP_
14 #include "crocoddyl/core/solver-base.hpp"
20 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
22 explicit SolverKKT(std::shared_ptr<ShootingProblem> problem);
26 const std::vector<Eigen::VectorXd>& init_xs = DEFAULT_VECTOR,
27 const std::vector<Eigen::VectorXd>& init_us = DEFAULT_VECTOR,
28 const std::size_t maxiter = 100,
const bool is_feasible =
false,
29 const double regInit = 1e-9);
31 virtual double tryStep(
const double steplength = 1);
35 const Eigen::MatrixXd& get_kkt()
const;
36 const Eigen::VectorXd& get_kktref()
const;
37 const Eigen::VectorXd& get_primaldual()
const;
38 const std::vector<Eigen::VectorXd>& get_dxs()
const;
39 const std::vector<Eigen::VectorXd>& get_dus()
const;
40 const std::vector<Eigen::VectorXd>& get_lambdas()
const;
41 std::size_t get_nx()
const;
42 std::size_t get_ndx()
const;
43 std::size_t get_nu()
const;
46 double reg_incfactor_;
47 double reg_decfactor_;
51 std::vector<Eigen::VectorXd> xs_try_;
52 std::vector<Eigen::VectorXd> us_try_;
56 void computePrimalDual();
57 void increaseRegularization();
58 void decreaseRegularization();
64 std::vector<Eigen::VectorXd> dxs_;
65 std::vector<Eigen::VectorXd> dus_;
66 std::vector<Eigen::VectorXd> lambdas_;
70 Eigen::VectorXd kktref_;
71 Eigen::VectorXd primaldual_;
72 Eigen::VectorXd primal_;
73 Eigen::VectorXd dual_;
74 std::vector<double> alphas_;
77 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 .