Go to the documentation of this file.
30 #ifndef EXOTICA_DDP_SOLVER_ABSTRACT_DDP_SOLVER_H_
31 #define EXOTICA_DDP_SOLVER_ABSTRACT_DDP_SOLVER_H_
37 #include <exotica_ddp_solver/abstract_ddp_solver_initializer.h>
48 void Solve(Eigen::MatrixXd& solution)
override;
57 const std::vector<Eigen::MatrixXd>&
get_Vxx()
const;
58 const std::vector<Eigen::VectorXd>&
get_Vx()
const;
59 const std::vector<Eigen::MatrixXd>&
get_Qxx()
const;
60 const std::vector<Eigen::MatrixXd>&
get_Qux()
const;
61 const std::vector<Eigen::MatrixXd>&
get_Quu()
const;
62 const std::vector<Eigen::VectorXd>&
get_Qx()
const;
63 const std::vector<Eigen::VectorXd>&
get_Qu()
const;
64 const std::vector<Eigen::MatrixXd>&
get_K()
const;
65 const std::vector<Eigen::VectorXd>&
get_k()
const;
67 const std::vector<Eigen::VectorXd>&
get_X_try()
const;
68 const std::vector<Eigen::VectorXd>&
get_U_try()
const;
70 const std::vector<Eigen::VectorXd>&
get_X_ref()
const;
71 const std::vector<Eigen::VectorXd>&
get_U_ref()
const;
73 const std::vector<Eigen::MatrixXd>&
get_Quu_inv()
const;
74 const std::vector<Eigen::MatrixXd>&
get_fx()
const;
75 const std::vector<Eigen::MatrixXd>&
get_fu()
const;
132 std::vector<Eigen::MatrixXd>
Vxx_;
133 std::vector<Eigen::VectorXd>
Vx_;
134 std::vector<Eigen::MatrixXd>
Qxx_;
135 std::vector<Eigen::MatrixXd>
Qux_;
136 std::vector<Eigen::MatrixXd>
Quu_;
137 std::vector<Eigen::VectorXd>
Qx_;
138 std::vector<Eigen::VectorXd>
Qu_;
139 std::vector<Eigen::MatrixXd>
K_;
140 std::vector<Eigen::VectorXd>
k_;
149 std::vector<Eigen::MatrixXd>
fx_;
150 std::vector<Eigen::MatrixXd>
fu_;
159 #endif // EXOTICA_DDP_SOLVER_ABSTRACT_DDP_SOLVER_H_
std::vector< Eigen::MatrixXd > Qxx_
Hessian of the Hamiltonian.
Definition: abstract_ddp_solver.h:134
std::vector< Eigen::MatrixXd > fu_
Derivative of the dynamics f w.r.t. u.
Definition: abstract_ddp_solver.h:150
std::vector< Eigen::MatrixXd > Qux_
Hessian of the Hamiltonian.
Definition: abstract_ddp_solver.h:135
std::vector< Eigen::VectorXd > U_try_
Updated control trajectory during iteration (computed by line-search)
Definition: abstract_ddp_solver.h:143
const std::vector< Eigen::MatrixXd > & get_K() const
const std::vector< Eigen::VectorXd > & get_Vx() const
double alpha_best_
Line-search step taken.
Definition: abstract_ddp_solver.h:129
std::vector< Eigen::VectorXd > Qu_
Gradient of the Hamiltonian.
Definition: abstract_ddp_solver.h:138
double time_taken_backward_pass_
Definition: abstract_ddp_solver.h:130
virtual void DecreaseRegularization()
Definition: abstract_ddp_solver.h:108
std::vector< Eigen::VectorXd > Vx_
Gradient of the Value function.
Definition: abstract_ddp_solver.h:133
double cost_prev_
Cost during previous iteration.
Definition: abstract_ddp_solver.h:128
std::vector< Eigen::VectorXd > U_ref_
Reference control trajectory for feedback control.
Definition: abstract_ddp_solver.h:146
double control_cost_try_
Total control cost computed by line-search procedure.
Definition: abstract_ddp_solver.h:126
DynamicsSolverPtr dynamics_solver_
Shared pointer to the dynamics solver.
Definition: abstract_ddp_solver.h:88
void Solve(Eigen::MatrixXd &solution) override
Solves the problem.
std::vector< Eigen::MatrixXd > Quu_inv_
Inverse of the Hessian of the Hamiltonian.
Definition: abstract_ddp_solver.h:148
std::vector< Eigen::VectorXd > Qx_
Gradient of the Hamiltonian.
Definition: abstract_ddp_solver.h:137
int NDX_
Size of tangent vector to the state vector.
Definition: abstract_ddp_solver.h:119
Definition: feedback_motion_solver.h:37
std::shared_ptr< exotica::DynamicsSolver > DynamicsSolverPtr
Definition: dynamics_solver.h:269
std::vector< Eigen::VectorXd > X_try_
Updated state trajectory during iteration (computed by line-search)
Definition: abstract_ddp_solver.h:142
std::vector< double > get_regularization_evolution() const
DynamicTimeIndexedShootingProblemPtr prob_
Shared pointer to the planning problem.
Definition: abstract_ddp_solver.h:87
Definition: cartpole_dynamics_solver.h:38
const std::vector< Eigen::VectorXd > & get_Qu() const
double ForwardPass(const double alpha)
Forward simulates the dynamics using the gains computed in the last BackwardPass;.
virtual void BackwardPass()=0
Computes the control gains for a the trajectory in the associated DynamicTimeIndexedProblem.
double time_taken_forward_pass_
Definition: abstract_ddp_solver.h:130
std::vector< Eigen::MatrixXd > K_
Feedback gains.
Definition: abstract_ddp_solver.h:139
const std::vector< Eigen::VectorXd > & get_U_try() const
Definition: abstract_ddp_solver.h:43
AbstractDDPSolverInitializer base_parameters_
Definition: abstract_ddp_solver.h:101
const typedef Eigen::Ref< const Eigen::VectorXd > & VectorXdRefConst
Convenience wrapper for storing references to sub-matrices/vectors.
Definition: conversions.h:52
std::vector< double > steplength_evolution_
Evolution of the steplength.
Definition: abstract_ddp_solver.h:153
const std::vector< Eigen::MatrixXd > & get_Qxx() const
const std::vector< Eigen::MatrixXd > & get_Quu_inv() const
const std::vector< Eigen::VectorXd > & get_Qx() const
const std::vector< Eigen::MatrixXd > & get_Vxx() const
std::shared_ptr< exotica::DynamicTimeIndexedShootingProblem > DynamicTimeIndexedShootingProblemPtr
Definition: dynamic_time_indexed_shooting_problem.h:231
Eigen::VectorXd alpha_space_
Backtracking line-search steplengths.
Definition: abstract_ddp_solver.h:114
double lambda_
Regularization (Vxx, Quu)
Definition: abstract_ddp_solver.h:115
std::vector< Eigen::MatrixXd > Quu_
Hessian of the Hamiltonian.
Definition: abstract_ddp_solver.h:136
double dt_
Integration time-step.
Definition: abstract_ddp_solver.h:121
double cost_try_
Total cost computed by line-search procedure.
Definition: abstract_ddp_solver.h:125
const std::vector< Eigen::MatrixXd > & get_Qux() const
std::shared_ptr< PlanningProblem > PlanningProblemPtr
Definition: planning_problem.h:116
std::vector< double > regularization_evolution_
Evolution of the regularization (xreg/ureg)
Definition: abstract_ddp_solver.h:154
Eigen::VectorXd GetFeedbackControl(Eigen::VectorXdRefConst x, int t) const override
int NV_
Size of velocity vector (tangent vector to the configuration)
Definition: abstract_ddp_solver.h:120
const std::vector< Eigen::VectorXd > & get_X_try() const
int NX_
Size of state vector.
Definition: abstract_ddp_solver.h:118
std::vector< double > get_control_cost_evolution() const
const std::vector< Eigen::VectorXd > & get_X_ref() const
const std::vector< Eigen::MatrixXd > & get_fx() const
virtual void IncreaseRegularization()
Definition: abstract_ddp_solver.h:103
std::vector< Eigen::MatrixXd > fx_
Derivative of the dynamics f w.r.t. x.
Definition: abstract_ddp_solver.h:149
const std::vector< Eigen::MatrixXd > & get_fu() const
void SpecifyProblem(PlanningProblemPtr pointer) override
Binds the solver to a specific problem which must be pre-initalised.
const std::vector< Eigen::VectorXd > & get_k() const
std::vector< Eigen::MatrixXd > Vxx_
Hessian of the Value function.
Definition: abstract_ddp_solver.h:132
int NU_
Size of control vector.
Definition: abstract_ddp_solver.h:117
std::vector< Eigen::VectorXd > X_ref_
Reference state trajectory for feedback control.
Definition: abstract_ddp_solver.h:145
void set_control_cost_evolution(const int index, const double cost)
double cost_
Cost during iteration.
Definition: abstract_ddp_solver.h:122
std::vector< double > get_steplength_evolution() const
int T_
Length of shooting problem, i.e., state trajectory. The control trajectory has length T_-1.
Definition: abstract_ddp_solver.h:116
double control_cost_
Control cost during iteration.
Definition: abstract_ddp_solver.h:123
std::vector< Eigen::VectorXd > k_
Feed-forward terms.
Definition: abstract_ddp_solver.h:140
const std::vector< Eigen::MatrixXd > & get_Quu() const
std::vector< double > control_cost_evolution_
Evolution of the control cost (control regularization)
Definition: abstract_ddp_solver.h:152
const std::vector< Eigen::VectorXd > & get_U_ref() const