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_ const std::vector< Eigen::VectorXd > & get_fs() const
double stop_
Value computed by CheckStoppingCriteria.
double initial_regularization_rate_
std::vector< Eigen::VectorXd > xs_
std::vector< Eigen::VectorXd > dx_
std::vector< Eigen::VectorXd > xs_try_
State trajectory computed by line-search procedure.
Eigen::MatrixXd FxTVxx_p_
double dV_
Cost reduction obtained by TryStep.
bool clamp_to_control_limits_in_forward_pass_
std::vector< Eigen::VectorXd > us_try_
Control trajectory computed by line-search procedure.
double regfactor_
Factor by which the regularization gets increased/decreased.
void SetCandidate(const std::vector< Eigen::VectorXd > &xs_warm, const std::vector< Eigen::VectorXd > &us_warm, const bool is_feasible)
const std::vector< Eigen::VectorXd > & get_us() const
std::vector< Eigen::MatrixXd > FuTVxx_p_
Eigen::MatrixXd control_limits_
std::vector< Eigen::VectorXd > us_
Eigen::Vector2d d_
LQ approximation of the expected improvement.
void IncreaseRegularization() override
double th_stepinc_
Step-length threshold used to increase regularization.
double th_acceptnegstep_
Threshold used for accepting step along ascent direction.
std::vector< Eigen::MatrixXd > Qxu_
std::vector< Eigen::VectorXd > Quuk_
void SpecifyProblem(PlanningProblemPtr pointer) override
Binds the solver to a specific problem which must be pre-initalised.
double th_acceptstep_
Threshold used for accepting step.
void UpdateExpectedImprovement()
double th_gradient_tolerance_
Gradient tolerance.
std::vector< Eigen::VectorXd > fs_
Gaps/defects between shooting nodes.
virtual void ComputeGains(const int t)
bool was_feasible_
Label that indicates in the previous iterate was feasible.
double th_grad_
Tolerance of the expected gradient used for testing the step.
bool ComputeDirection(const bool recalcDiff)
const Eigen::Vector2d & ExpectedImprovement()
double CheckStoppingCriteria()
double xreg_
State regularization.
double th_stop_
Tolerance for stopping the algorithm.
double ureg_
Control regularization.
virtual bool BackwardPassFDDP()
void DecreaseRegularization() override
double th_stepdec_
Step-length threshold used to decrease regularization.
double steplength_
Current applied step-length.
void BackwardPass() override
Computes the control gains for a the trajectory in the associated DynamicTimeIndexedProblem.
void ForwardPass(const double steplength)
double regmin_
Minimum regularization (will not decrease lower)
std::vector< Eigen::LDLT< Eigen::MatrixXd > > Quu_ldlt_
std::shared_ptr< PlanningProblem > PlanningProblemPtr
double dVexp_
Expected cost reduction.
const std::vector< Eigen::VectorXd > & get_xs() const
void Solve(Eigen::MatrixXd &solution) override
Solves the problem.
virtual void AllocateData()
bool IsNaN(const double value)
double regmax_
Maximum regularization (to exit by divergence)
double TryStep(const double steplength)