crocoddyl  1.3.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
fddp.hpp
1 // BSD 3-Clause License
3 //
4 // Copyright (C) 2018-2020, LAAS-CNRS, University of Edinburgh
5 // Copyright note valid unless otherwise stated in individual files.
6 // All rights reserved.
8 
9 #ifndef CROCODDYL_CORE_SOLVERS_FDDP_HPP_
10 #define CROCODDYL_CORE_SOLVERS_FDDP_HPP_
11 
12 #include <Eigen/Cholesky>
13 #include <vector>
14 
15 #include "crocoddyl/core/solvers/ddp.hpp"
16 
17 namespace crocoddyl {
18 
19 class SolverFDDP : public SolverDDP {
20  public:
21  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
22 
23  explicit SolverFDDP(boost::shared_ptr<ShootingProblem> problem);
24  virtual ~SolverFDDP();
25 
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 const Eigen::Vector2d& expectedImprovement();
30  void updateExpectedImprovement();
31  virtual double calcDiff();
32  virtual void forwardPass(const double& stepLength);
33 
34  double get_th_acceptnegstep() const;
35  void set_th_acceptnegstep(const double& th_acceptnegstep);
36 
37  protected:
38  double dg_;
39  double dq_;
40  double dv_;
41 
42  private:
43  double th_acceptnegstep_;
44 };
45 
46 } // namespace crocoddyl
47 
48 #endif // CROCODDYL_CORE_SOLVERS_FDDP_HPP_