Template Class SolverBoxFDDPTpl

Inheritance Relationships

Base Type

Class Documentation

template<typename _Scalar>
class SolverBoxFDDPTpl : public crocoddyl::SolverFDDPTpl<_Scalar>

Public Types

typedef SolverFDDPTpl<Scalar> SolverFDDP
typedef BoxQPTpl<Scalar> BoxQP
typedef BoxQPSolutionTpl<Scalar> BoxQPSolution
typedef ShootingProblemTpl<Scalar> ShootingProblem
typedef ShootingProblem::ActionModelAbstract ActionModelAbstract
typedef ShootingProblem::ActionDataAbstract ActionDataAbstract
typedef MathBaseTpl<Scalar> MathBase
typedef MathBase::VectorXs VectorXs
typedef MathBase::MatrixXs MatrixXs

Public Functions

explicit SolverBoxFDDPTpl(std::shared_ptr<ShootingProblem> problem, const DynamicsSolverType dyn_solver = FeasShoot, const EqualitySolverType term_solver = LuNull)
virtual ~SolverBoxFDDPTpl() = default
virtual void computePolicy(const std::size_t t) override

Compute the feedforward and feedback terms (control policy) computed via a Cholesky decomposition.

To compute the feedforward \(\mathbf{k}_k\) and feedback \(\mathbf{K}_k\) terms, we use a Cholesky decomposition to solve \(\mathbf{Q}_{\mathbf{uu}_k}^{-1}\) term:

\[\begin{split}\begin{eqnarray}\mathbf{k}_k &=& \mathbf{Q}_{\mathbf{uu}_k}^{-1}\mathbf{Q}_{\mathbf{u}},\\ \mathbf{K}_k &=& \mathbf{Q}_{\mathbf{uu}_k}^{-1}\mathbf{Q}_{\mathbf{ux}}. \end{eqnarray}\end{split}\]

Note that if the Cholesky decomposition fails, then we re-start the backward pass and increase the state and control regularization values.

virtual void forwardPass(const Scalar steplength)
template<typename NewScalar>
SolverBoxFDDPTpl<NewScalar> cast() const

Cast the Box-FDDP solver to a different scalar type.

It is useful for operations requiring different precision or scalar types.

Template Parameters:

NewScalar – The new scalar type to cast to.

Returns:

SolverBoxFDDPTpl<NewScalar> An Box-FDDP solver with the new scalar type.

const std::vector<MatrixXs> &get_Quu_inv() const

Public Members

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Protected Functions

void allocateData()
virtual void resizeRunningData() override

Resize data associated with the running models of the shooting problem.

Protected Attributes

BoxQP qp_
std::vector<MatrixXs> Quu_inv_
std::vector<VectorXs> du_lb_
std::vector<VectorXs> du_ub_
VectorXs xnext_

Next state \(\mathbf{x}^{'}\).

std::vector<VectorXs> dx_

State error during the roll-out/forward-pass (size T).

DynamicsSolverType dyn_solver_

Type of dynamics solver.

std::vector<MatrixXsRowMajor> K_

Feedback gains \(\mathbf{K}\).

std::vector<VectorXs> k_

Feed-forward terms \(\mathbf{l}\).

std::vector<VectorXs> Qu_

Gradient of the Hamiltonian \(\mathbf{Q_u}\).

std::vector<MatrixXs> Quu_

Hessian of the Hamiltonian \(\mathbf{Q_{uu}}\).

std::vector<MatrixXs> Qxu_

Hessian of the Hamiltonian \(\mathbf{Q_{xu}}\).

Scalar reg_decfactor_

Regularization factor used to decrease the damping value

Scalar reg_incfactor_

Regularization factor used to increase the damping value

Scalar rho_

Parameter used in the merit function to predict the expected reduction

EqualitySolverType term_solver_

Type of terminal solver.

Scalar th_acceptminstep_

Threshold used for accepting step along with a minimum length

Scalar th_acceptnegstep_

Threshold used for accepting step along ascent direction

Scalar th_grad_

Tolerance of the expected gradient used for testing the step

Scalar th_minfeas_

Threshold for switching to feasibility.

Scalar th_minimprove_

Minimum improvement threshold used in the regularization scheme

Scalar th_noimprovement_

Threshold used to accept steps that cannot be be improved due to numerical errors

Scalar th_stepdec_

Step-length threshold used to decrease regularization.

Scalar th_stepinc_

Step-length threshold used to increase regularization.

Scalar upsilon_decfactor_

Estimated penalty parameter factor used to decrease its value

std::vector<VectorXs> Vx_

Gradient of the Value function \(\mathbf{V_x}\).

std::vector<MatrixXs> Vxx_

Hessian of the Value function \(\mathbf{V_{xx}}\).

bool zero_upsilon_

True if we wish to set estimated penalty parameter (upsilon) to zero when solve is called.