Go to the documentation of this file.
30 #ifndef EXOTICA_DDP_SOLVER_FEASIBILITY_DRIVEN_DDP_SOLVER_H_
31 #define EXOTICA_DDP_SOLVER_FEASIBILITY_DRIVEN_DDP_SOLVER_H_
34 #include <exotica_ddp_solver/feasibility_driven_ddp_solver_initializer.h>
44 void Solve(Eigen::MatrixXd& solution)
override;
47 const std::vector<Eigen::VectorXd>&
get_fs()
const {
return fs_; };
48 const std::vector<Eigen::VectorXd>&
get_xs()
const {
return xs_; };
49 const std::vector<Eigen::VectorXd>&
get_us()
const {
return us_; };
59 inline bool IsNaN(
const double value)
61 if (std::isnan(value) || std::isinf(value) || value >= 1e30)
70 void SetCandidate(
const std::vector<Eigen::VectorXd>& xs_warm,
const std::vector<Eigen::VectorXd>& us_warm,
const bool is_feasible);
79 double TryStep(
const double steplength);
100 std::vector<Eigen::VectorXd>
us_;
101 std::vector<Eigen::VectorXd>
xs_;
111 std::vector<Eigen::VectorXd>
dx_;
114 std::vector<Eigen::VectorXd>
fs_;
119 std::vector<Eigen::MatrixXd>
Qxu_;
132 void Instantiate(
const FeasibilityDrivenDDPSolverInitializer& init)
override;
137 #endif // EXOTICA_DDP_SOLVER_FEASIBILITY_DRIVEN_DDP_SOLVER_H_
bool clamp_to_control_limits_in_forward_pass_
Definition: feasibility_driven_ddp_solver.h:85
Definition: feasibility_driven_ddp_solver.h:129
std::vector< Eigen::VectorXd > us_try_
Control trajectory computed by line-search procedure.
Definition: feasibility_driven_ddp_solver.h:110
void Solve(Eigen::MatrixXd &solution) override
Solves the problem.
const Eigen::Vector2d & ExpectedImprovement()
virtual void ComputeGains(const int t)
Eigen::VectorXd fTVxx_p_
Definition: feasibility_driven_ddp_solver.h:120
void ForwardPass(const double steplength)
virtual bool BackwardPassFDDP()
std::vector< Eigen::VectorXd > fs_
Gaps/defects between shooting nodes.
Definition: feasibility_driven_ddp_solver.h:114
int NDX_
Definition: feasibility_driven_ddp_solver.h:49
void Instantiate(const FeasibilityDrivenDDPSolverInitializer &init) override
double th_stepinc_
Step-length threshold used to increase regularization.
Definition: feasibility_driven_ddp_solver.h:125
Definition: feasibility_driven_ddp_solver.h:41
Definition: property.h:110
double steplength_
Current applied step-length.
Definition: feasibility_driven_ddp_solver.h:87
std::vector< Eigen::VectorXd > xs_try_
State trajectory computed by line-search procedure.
Definition: feasibility_driven_ddp_solver.h:109
Definition: cartpole_dynamics_solver.h:38
const std::vector< Eigen::VectorXd > & get_us() const
Definition: feasibility_driven_ddp_solver.h:49
bool is_feasible_
Definition: feasibility_driven_ddp_solver.h:102
double ureg_
Control regularization.
Definition: feasibility_driven_ddp_solver.h:104
double regmax_
Maximum regularization (to exit by divergence)
Definition: feasibility_driven_ddp_solver.h:106
double th_acceptstep_
Threshold used for accepting step.
Definition: feasibility_driven_ddp_solver.h:91
double dg_
Definition: feasibility_driven_ddp_solver.h:96
void UpdateExpectedImprovement()
double dq_
Definition: feasibility_driven_ddp_solver.h:97
double initial_regularization_rate_
Definition: feasibility_driven_ddp_solver.h:84
double xreg_
State regularization.
Definition: feasibility_driven_ddp_solver.h:103
double th_stop_
Tolerance for stopping the algorithm.
Definition: feasibility_driven_ddp_solver.h:92
double dV_
Cost reduction obtained by TryStep.
Definition: feasibility_driven_ddp_solver.h:89
Definition: abstract_ddp_solver.h:43
double dVexp_
Expected cost reduction.
Definition: feasibility_driven_ddp_solver.h:90
double regfactor_
Factor by which the regularization gets increased/decreased.
Definition: feasibility_driven_ddp_solver.h:107
int last_T_
Definition: feasibility_driven_ddp_solver.h:53
Eigen::Vector2d d_
LQ approximation of the expected improvement.
Definition: feasibility_driven_ddp_solver.h:88
double dv_
Definition: feasibility_driven_ddp_solver.h:98
std::vector< Eigen::VectorXd > Quuk_
Definition: feasibility_driven_ddp_solver.h:122
void SpecifyProblem(PlanningProblemPtr pointer) override
Binds the solver to a specific problem which must be pre-initalised.
Eigen::MatrixXd control_limits_
Definition: feasibility_driven_ddp_solver.h:83
Eigen::VectorXd xnext_
Definition: feasibility_driven_ddp_solver.h:116
std::vector< Eigen::MatrixXd > Qxu_
Definition: feasibility_driven_ddp_solver.h:119
double CheckStoppingCriteria()
std::vector< Eigen::VectorXd > xs_
Definition: feasibility_driven_ddp_solver.h:101
void DecreaseRegularization() override
bool was_feasible_
Label that indicates in the previous iterate was feasible.
Definition: feasibility_driven_ddp_solver.h:126
double stop_
Value computed by CheckStoppingCriteria.
Definition: feasibility_driven_ddp_solver.h:94
bool IsNaN(const double value)
Definition: feasibility_driven_ddp_solver.h:59
std::shared_ptr< PlanningProblem > PlanningProblemPtr
Definition: planning_problem.h:116
virtual void AllocateData()
double th_grad_
Tolerance of the expected gradient used for testing the step.
Definition: feasibility_driven_ddp_solver.h:123
void SetCandidate(const std::vector< Eigen::VectorXd > &xs_warm, const std::vector< Eigen::VectorXd > &us_warm, const bool is_feasible)
double th_gradient_tolerance_
Gradient tolerance.
Definition: feasibility_driven_ddp_solver.h:93
void BackwardPass() override
Computes the control gains for a the trajectory in the associated DynamicTimeIndexedProblem.
Definition: feasibility_driven_ddp_solver.h:76
const std::vector< Eigen::VectorXd > & get_xs() const
Definition: feasibility_driven_ddp_solver.h:48
std::vector< Eigen::VectorXd > us_
Definition: feasibility_driven_ddp_solver.h:100
double regmin_
Minimum regularization (will not decrease lower)
Definition: feasibility_driven_ddp_solver.h:105
std::vector< Eigen::LDLT< Eigen::MatrixXd > > Quu_ldlt_
Definition: feasibility_driven_ddp_solver.h:121
bool ComputeDirection(const bool recalcDiff)
Eigen::MatrixXd FxTVxx_p_
Definition: feasibility_driven_ddp_solver.h:117
double th_stepdec_
Step-length threshold used to decrease regularization.
Definition: feasibility_driven_ddp_solver.h:124
const std::vector< Eigen::VectorXd > & get_fs() const
Definition: feasibility_driven_ddp_solver.h:47
double TryStep(const double steplength)
double th_acceptnegstep_
Threshold used for accepting step along ascent direction.
Definition: feasibility_driven_ddp_solver.h:99
void IncreaseRegularization() override
std::vector< Eigen::MatrixXd > FuTVxx_p_
Definition: feasibility_driven_ddp_solver.h:118
std::vector< Eigen::VectorXd > dx_
Definition: feasibility_driven_ddp_solver.h:111