Exotica
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
exotica::AbstractDDPSolver Class Referenceabstract

#include <abstract_ddp_solver.h>

Inheritance diagram for exotica::AbstractDDPSolver:
Inheritance graph
Collaboration diagram for exotica::AbstractDDPSolver:
Collaboration graph

Public Member Functions

void Solve (Eigen::MatrixXd &solution) override
 Solves the problem. More...
 
void SpecifyProblem (PlanningProblemPtr pointer) override
 Binds the solver to a specific problem which must be pre-initalised. More...
 
Eigen::VectorXd GetFeedbackControl (Eigen::VectorXdRefConst x, int t) const override
 
const std::vector< Eigen::MatrixXd > & get_Vxx () const
 
const std::vector< Eigen::VectorXd > & get_Vx () const
 
const std::vector< Eigen::MatrixXd > & get_Qxx () const
 
const std::vector< Eigen::MatrixXd > & get_Qux () const
 
const std::vector< Eigen::MatrixXd > & get_Quu () const
 
const std::vector< Eigen::VectorXd > & get_Qx () const
 
const std::vector< Eigen::VectorXd > & get_Qu () const
 
const std::vector< Eigen::MatrixXd > & get_K () const
 
const std::vector< Eigen::VectorXd > & get_k () const
 
const std::vector< Eigen::VectorXd > & get_X_try () const
 
const std::vector< Eigen::VectorXd > & get_U_try () const
 
const std::vector< Eigen::VectorXd > & get_X_ref () const
 
const std::vector< Eigen::VectorXd > & get_U_ref () const
 
const std::vector< Eigen::MatrixXd > & get_Quu_inv () const
 
const std::vector< Eigen::MatrixXd > & get_fx () const
 
const std::vector< Eigen::MatrixXd > & get_fu () const
 
std::vector< double > get_control_cost_evolution () const
 
void set_control_cost_evolution (const int index, const double cost)
 
std::vector< double > get_steplength_evolution () const
 
std::vector< double > get_regularization_evolution () const
 
- Public Member Functions inherited from exotica::MotionSolver
 MotionSolver ()=default
 
virtual ~MotionSolver ()=default
 
void InstantiateBase (const Initializer &init) override
 
PlanningProblemPtr GetProblem () const
 
std::string Print (const std::string &prepend) const override
 
void SetNumberOfMaxIterations (int max_iter)
 
int GetNumberOfMaxIterations ()
 
double GetPlanningTime ()
 
- Public Member Functions inherited from exotica::Object
 Object ()
 
virtual ~Object ()
 
virtual std::string type () const
 Type Information wrapper: must be virtual so that it is polymorphic... More...
 
std::string GetObjectName ()
 
void InstantiateObject (const Initializer &init)
 
- Public Member Functions inherited from exotica::InstantiableBase
 InstantiableBase ()=default
 
virtual ~InstantiableBase ()=default
 
virtual Initializer GetInitializerTemplate ()=0
 
virtual void InstantiateInternal (const Initializer &init)=0
 
virtual std::vector< InitializerGetAllTemplates () const =0
 

Protected Member Functions

virtual void BackwardPass ()=0
 Computes the control gains for a the trajectory in the associated DynamicTimeIndexedProblem. More...
 
double ForwardPass (const double alpha)
 Forward simulates the dynamics using the gains computed in the last BackwardPass;. More...
 
virtual void IncreaseRegularization ()
 
virtual void DecreaseRegularization ()
 

Protected Attributes

DynamicTimeIndexedShootingProblemPtr prob_
 Shared pointer to the planning problem. More...
 
DynamicsSolverPtr dynamics_solver_
 Shared pointer to the dynamics solver. More...
 
AbstractDDPSolverInitializer base_parameters_
 
Eigen::VectorXd alpha_space_
 Backtracking line-search steplengths. More...
 
double lambda_
 Regularization (Vxx, Quu) More...
 
int T_
 Length of shooting problem, i.e., state trajectory. The control trajectory has length T_-1. More...
 
int NU_
 Size of control vector. More...
 
int NX_
 Size of state vector. More...
 
int NDX_
 Size of tangent vector to the state vector. More...
 
int NV_
 Size of velocity vector (tangent vector to the configuration) More...
 
double dt_
 Integration time-step. More...
 
double cost_
 Cost during iteration. More...
 
double control_cost_
 Control cost during iteration. More...
 
double cost_try_
 Total cost computed by line-search procedure. More...
 
double control_cost_try_
 Total control cost computed by line-search procedure. More...
 
double cost_prev_
 Cost during previous iteration. More...
 
double alpha_best_
 Line-search step taken. More...
 
double time_taken_forward_pass_
 
double time_taken_backward_pass_
 
std::vector< Eigen::MatrixXd > Vxx_
 Hessian of the Value function. More...
 
std::vector< Eigen::VectorXd > Vx_
 Gradient of the Value function. More...
 
std::vector< Eigen::MatrixXd > Qxx_
 Hessian of the Hamiltonian. More...
 
std::vector< Eigen::MatrixXd > Qux_
 Hessian of the Hamiltonian. More...
 
std::vector< Eigen::MatrixXd > Quu_
 Hessian of the Hamiltonian. More...
 
std::vector< Eigen::VectorXd > Qx_
 Gradient of the Hamiltonian. More...
 
std::vector< Eigen::VectorXd > Qu_
 Gradient of the Hamiltonian. More...
 
std::vector< Eigen::MatrixXd > K_
 Feedback gains. More...
 
std::vector< Eigen::VectorXd > k_
 Feed-forward terms. More...
 
std::vector< Eigen::VectorXd > X_try_
 Updated state trajectory during iteration (computed by line-search) More...
 
std::vector< Eigen::VectorXd > U_try_
 Updated control trajectory during iteration (computed by line-search) More...
 
std::vector< Eigen::VectorXd > X_ref_
 Reference state trajectory for feedback control. More...
 
std::vector< Eigen::VectorXd > U_ref_
 Reference control trajectory for feedback control. More...
 
std::vector< Eigen::MatrixXd > Quu_inv_
 Inverse of the Hessian of the Hamiltonian. More...
 
std::vector< Eigen::MatrixXd > fx_
 Derivative of the dynamics f w.r.t. x. More...
 
std::vector< Eigen::MatrixXd > fu_
 Derivative of the dynamics f w.r.t. u. More...
 
std::vector< double > control_cost_evolution_
 Evolution of the control cost (control regularization) More...
 
std::vector< double > steplength_evolution_
 Evolution of the steplength. More...
 
std::vector< double > regularization_evolution_
 Evolution of the regularization (xreg/ureg) More...
 
- Protected Attributes inherited from exotica::MotionSolver
PlanningProblemPtr problem_
 
double planning_time_ = -1
 
int max_iterations_ = 100
 

Additional Inherited Members

- Public Attributes inherited from exotica::Object
std::string ns_
 
std::string object_name_
 
bool debug_
 

Member Function Documentation

◆ BackwardPass()

virtual void exotica::AbstractDDPSolver::BackwardPass ( )
protectedpure virtual

Computes the control gains for a the trajectory in the associated DynamicTimeIndexedProblem.

Implemented in exotica::AbstractFeasibilityDrivenDDPSolver, exotica::AnalyticDDPSolver, and exotica::ControlLimitedDDPSolver.

◆ DecreaseRegularization()

virtual void exotica::AbstractDDPSolver::DecreaseRegularization ( )
inlineprotectedvirtual

◆ ForwardPass()

double exotica::AbstractDDPSolver::ForwardPass ( const double  alpha)
protected

Forward simulates the dynamics using the gains computed in the last BackwardPass;.

Parameters
alphaThe learning rate.
ref_trajectoryThe reference state trajectory.
Returns
The cost associated with the new control and state trajectory.

◆ get_control_cost_evolution()

std::vector<double> exotica::AbstractDDPSolver::get_control_cost_evolution ( ) const

◆ get_fu()

const std::vector<Eigen::MatrixXd>& exotica::AbstractDDPSolver::get_fu ( ) const

◆ get_fx()

const std::vector<Eigen::MatrixXd>& exotica::AbstractDDPSolver::get_fx ( ) const

◆ get_K()

const std::vector<Eigen::MatrixXd>& exotica::AbstractDDPSolver::get_K ( ) const

◆ get_k()

const std::vector<Eigen::VectorXd>& exotica::AbstractDDPSolver::get_k ( ) const

◆ get_Qu()

const std::vector<Eigen::VectorXd>& exotica::AbstractDDPSolver::get_Qu ( ) const

◆ get_Quu()

const std::vector<Eigen::MatrixXd>& exotica::AbstractDDPSolver::get_Quu ( ) const

◆ get_Quu_inv()

const std::vector<Eigen::MatrixXd>& exotica::AbstractDDPSolver::get_Quu_inv ( ) const

◆ get_Qux()

const std::vector<Eigen::MatrixXd>& exotica::AbstractDDPSolver::get_Qux ( ) const

◆ get_Qx()

const std::vector<Eigen::VectorXd>& exotica::AbstractDDPSolver::get_Qx ( ) const

◆ get_Qxx()

const std::vector<Eigen::MatrixXd>& exotica::AbstractDDPSolver::get_Qxx ( ) const

◆ get_regularization_evolution()

std::vector<double> exotica::AbstractDDPSolver::get_regularization_evolution ( ) const

◆ get_steplength_evolution()

std::vector<double> exotica::AbstractDDPSolver::get_steplength_evolution ( ) const

◆ get_U_ref()

const std::vector<Eigen::VectorXd>& exotica::AbstractDDPSolver::get_U_ref ( ) const

◆ get_U_try()

const std::vector<Eigen::VectorXd>& exotica::AbstractDDPSolver::get_U_try ( ) const

◆ get_Vx()

const std::vector<Eigen::VectorXd>& exotica::AbstractDDPSolver::get_Vx ( ) const

◆ get_Vxx()

const std::vector<Eigen::MatrixXd>& exotica::AbstractDDPSolver::get_Vxx ( ) const

◆ get_X_ref()

const std::vector<Eigen::VectorXd>& exotica::AbstractDDPSolver::get_X_ref ( ) const

◆ get_X_try()

const std::vector<Eigen::VectorXd>& exotica::AbstractDDPSolver::get_X_try ( ) const

◆ GetFeedbackControl()

Eigen::VectorXd exotica::AbstractDDPSolver::GetFeedbackControl ( Eigen::VectorXdRefConst  x,
int  t 
) const
overridevirtual

◆ IncreaseRegularization()

virtual void exotica::AbstractDDPSolver::IncreaseRegularization ( )
inlineprotectedvirtual

◆ set_control_cost_evolution()

void exotica::AbstractDDPSolver::set_control_cost_evolution ( const int  index,
const double  cost 
)

◆ Solve()

void exotica::AbstractDDPSolver::Solve ( Eigen::MatrixXd &  solution)
overridevirtual

Solves the problem.

Parameters
solutionReturned solution trajectory as a vector of joint configurations.

Implements exotica::MotionSolver.

Reimplemented in exotica::AbstractFeasibilityDrivenDDPSolver.

◆ SpecifyProblem()

void exotica::AbstractDDPSolver::SpecifyProblem ( PlanningProblemPtr  pointer)
overridevirtual

Binds the solver to a specific problem which must be pre-initalised.

Parameters
pointerShared pointer to the motion planning problem
Returns
Successful if the problem is a valid DynamicTimeIndexedProblem

Reimplemented from exotica::MotionSolver.

Reimplemented in exotica::AbstractFeasibilityDrivenDDPSolver.

Member Data Documentation

◆ alpha_best_

double exotica::AbstractDDPSolver::alpha_best_
protected

Line-search step taken.

◆ alpha_space_

Eigen::VectorXd exotica::AbstractDDPSolver::alpha_space_
protected

Backtracking line-search steplengths.

◆ base_parameters_

AbstractDDPSolverInitializer exotica::AbstractDDPSolver::base_parameters_
protected

◆ control_cost_

double exotica::AbstractDDPSolver::control_cost_
protected

Control cost during iteration.

◆ control_cost_evolution_

std::vector<double> exotica::AbstractDDPSolver::control_cost_evolution_
protected

Evolution of the control cost (control regularization)

◆ control_cost_try_

double exotica::AbstractDDPSolver::control_cost_try_
protected

Total control cost computed by line-search procedure.

◆ cost_

double exotica::AbstractDDPSolver::cost_
protected

Cost during iteration.

◆ cost_prev_

double exotica::AbstractDDPSolver::cost_prev_
protected

Cost during previous iteration.

◆ cost_try_

double exotica::AbstractDDPSolver::cost_try_
protected

Total cost computed by line-search procedure.

◆ dt_

double exotica::AbstractDDPSolver::dt_
protected

Integration time-step.

◆ dynamics_solver_

DynamicsSolverPtr exotica::AbstractDDPSolver::dynamics_solver_
protected

Shared pointer to the dynamics solver.

◆ fu_

std::vector<Eigen::MatrixXd> exotica::AbstractDDPSolver::fu_
protected

Derivative of the dynamics f w.r.t. u.

◆ fx_

std::vector<Eigen::MatrixXd> exotica::AbstractDDPSolver::fx_
protected

Derivative of the dynamics f w.r.t. x.

◆ K_

std::vector<Eigen::MatrixXd> exotica::AbstractDDPSolver::K_
protected

Feedback gains.

◆ k_

std::vector<Eigen::VectorXd> exotica::AbstractDDPSolver::k_
protected

Feed-forward terms.

◆ lambda_

double exotica::AbstractDDPSolver::lambda_
protected

Regularization (Vxx, Quu)

◆ NDX_

int exotica::AbstractDDPSolver::NDX_
protected

Size of tangent vector to the state vector.

◆ NU_

int exotica::AbstractDDPSolver::NU_
protected

Size of control vector.

◆ NV_

int exotica::AbstractDDPSolver::NV_
protected

Size of velocity vector (tangent vector to the configuration)

◆ NX_

int exotica::AbstractDDPSolver::NX_
protected

Size of state vector.

◆ prob_

DynamicTimeIndexedShootingProblemPtr exotica::AbstractDDPSolver::prob_
protected

Shared pointer to the planning problem.

◆ Qu_

std::vector<Eigen::VectorXd> exotica::AbstractDDPSolver::Qu_
protected

Gradient of the Hamiltonian.

◆ Quu_

std::vector<Eigen::MatrixXd> exotica::AbstractDDPSolver::Quu_
protected

Hessian of the Hamiltonian.

◆ Quu_inv_

std::vector<Eigen::MatrixXd> exotica::AbstractDDPSolver::Quu_inv_
protected

Inverse of the Hessian of the Hamiltonian.

◆ Qux_

std::vector<Eigen::MatrixXd> exotica::AbstractDDPSolver::Qux_
protected

Hessian of the Hamiltonian.

◆ Qx_

std::vector<Eigen::VectorXd> exotica::AbstractDDPSolver::Qx_
protected

Gradient of the Hamiltonian.

◆ Qxx_

std::vector<Eigen::MatrixXd> exotica::AbstractDDPSolver::Qxx_
protected

Hessian of the Hamiltonian.

◆ regularization_evolution_

std::vector<double> exotica::AbstractDDPSolver::regularization_evolution_
protected

Evolution of the regularization (xreg/ureg)

◆ steplength_evolution_

std::vector<double> exotica::AbstractDDPSolver::steplength_evolution_
protected

Evolution of the steplength.

◆ T_

int exotica::AbstractDDPSolver::T_
protected

Length of shooting problem, i.e., state trajectory. The control trajectory has length T_-1.

◆ time_taken_backward_pass_

double exotica::AbstractDDPSolver::time_taken_backward_pass_
protected

◆ time_taken_forward_pass_

double exotica::AbstractDDPSolver::time_taken_forward_pass_
protected

◆ U_ref_

std::vector<Eigen::VectorXd> exotica::AbstractDDPSolver::U_ref_
protected

Reference control trajectory for feedback control.

◆ U_try_

std::vector<Eigen::VectorXd> exotica::AbstractDDPSolver::U_try_
protected

Updated control trajectory during iteration (computed by line-search)

◆ Vx_

std::vector<Eigen::VectorXd> exotica::AbstractDDPSolver::Vx_
protected

Gradient of the Value function.

◆ Vxx_

std::vector<Eigen::MatrixXd> exotica::AbstractDDPSolver::Vxx_
protected

Hessian of the Value function.

◆ X_ref_

std::vector<Eigen::VectorXd> exotica::AbstractDDPSolver::X_ref_
protected

Reference state trajectory for feedback control.

◆ X_try_

std::vector<Eigen::VectorXd> exotica::AbstractDDPSolver::X_try_
protected

Updated state trajectory during iteration (computed by line-search)


The documentation for this class was generated from the following file: