Crocoddyl
Loading...
Searching...
No Matches
SolverBoxFDDPTpl< _Scalar > Class Template Reference
Inheritance diagram for SolverBoxFDDPTpl< _Scalar >:
SolverFDDPTpl< _Scalar >SolverAbstractTpl< _Scalar >SolverBase

Public Types

typedef ShootingProblem::ActionDataAbstract ActionDataAbstract
typedef ShootingProblem::ActionModelAbstract ActionModelAbstract
typedef BoxQPTpl< Scalar > BoxQP
typedef BoxQPSolutionTpl< Scalar > BoxQPSolution
typedef MathBaseTpl< Scalar > MathBase
typedef MathBase::MatrixXs MatrixXs
typedef ShootingProblemTpl< Scalar > ShootingProblem
typedef SolverFDDPTpl< Scalar > SolverFDDP
typedef MathBase::VectorXs VectorXs
Public Types inherited from SolverFDDPTpl< _Scalar >
typedef ShootingProblem::ActionDataAbstract ActionDataAbstract
typedef ShootingProblem::ActionModelAbstract ActionModelAbstract
typedef CallbackAbstractTpl< Scalar > CallbackAbstract
typedef MathBaseTpl< Scalar > MathBase
typedef MathBase::MatrixXs MatrixXs
typedef MathBase::MatrixXsRowMajor MatrixXsRowMajor
typedef ShootingProblemTpl< Scalar > ShootingProblem
typedef SolverAbstractTpl< Scalar > SolverAbstract
typedef MathBase::Vector3s Vector3s
typedef MathBase::VectorXs VectorXs
Public Types inherited from SolverAbstractTpl< _Scalar >
typedef ShootingProblem::ActionDataAbstract ActionDataAbstract
typedef ShootingProblem::ActionModelAbstract ActionModelAbstract
typedef CallbackAbstractTpl< Scalar > CallbackAbstract
typedef MathBaseTpl< Scalar > MathBase
typedef ShootingProblemTpl< Scalar > ShootingProblem
typedef MathBase::Vector3s Vector3s
typedef MathBase::VectorXs VectorXs

Public Member Functions

 SolverBoxFDDPTpl (std::shared_ptr< ShootingProblem > problem, const DynamicsSolverType dyn_solver=FeasShoot, const EqualitySolverType term_solver=LuNull)
template<typename NewScalar>
SolverBoxFDDPTpl< NewScalar > cast () const
 Cast the Box-FDDP solver to a different scalar type.
virtual void computePolicy (const std::size_t t) override
 Compute the feedforward and feedback terms (control policy) computed via a Cholesky decomposition.
virtual void forwardPass (const Scalar steplength)
const std::vector< MatrixXs > & get_Quu_inv () const
Public Member Functions inherited from SolverFDDPTpl< _Scalar >
 SolverFDDPTpl (std::shared_ptr< ShootingProblem > problem, const DynamicsSolverType dyn_solver=FeasShoot, const EqualitySolverType term_solver=LuNull)
 Initialize the FDDP solver.
virtual void backwardPass ()
 Run the backward pass (Riccati sweep).
void batchPass ()
 Run the batch pass to account for its constraints.
template<typename NewScalar>
SolverFDDPTpl< NewScalar > cast () const
 Cast the FDDP solver to a different scalar type.
virtual bool checkAcceptance () override
 Check if we should accept or not the step.
virtual void computeActionValueFunction (const std::size_t t, const std::shared_ptr< ActionModelAbstract > &model, const std::shared_ptr< ActionDataAbstract > &data)
 Compute the linear-quadratic approximation of the control action-value function.
virtual void computeBatchActionValueFunction (const std::size_t t, const std::shared_ptr< ActionDataAbstract > &data)
 Compute the linear-quadratic approximation of the control action-value function associated to the batch's constraints.
virtual void computeBatchPolicy (const std::size_t t)
 Compute the feedforward and feedback terms (control policy) associated to the batch's constraints.
virtual void computeBatchValueFunction (const std::size_t t)
 Compute the linear-quadratic approximation of the value function associated to the batch's constraints.
virtual void computeCandidate (const Scalar step_length=Scalar(1.)) override
 Compute new candidate solution using step length.
virtual void computeDirection (const bool recalc=true) override
 Compute the search direction $(\delta\mathbf{x}^k,\delta\mathbf{u}^k)$ for the current guess $(\mathbf{x}^k_s,\mathbf{u}^k_s)$.
Scalar computeDynamicFeasibility ()
 Compute the dynamic feasibility $\|\mathbf{f}_{\mathbf{s}}\|_{\infty,1}$ for the current guess $(\mathbf{x}^k,\mathbf{u}^k)$.
Scalar computeEqualityFeasibility ()
 Compute the feasibility of the equality constraints for the current guess.
virtual void computeExpectedMeritFunctionImprovement () override
 Compute the expected merit function improvement for the current step.
Scalar computeFeasibility (const std::vector< VectorXs > &fs)
 Compute the feasibility from a given residual vector.
Scalar computeInequalityFeasibility ()
 Compute the feasibility of the inequality constraints for the current guess.
virtual void computeMeritFunctionImprovement () override
 Compute the merit function improvement for the current step.
virtual void computeValueFunction (const std::size_t t, const std::shared_ptr< ActionModelAbstract > &model)
 Compute the linear-quadratic approximation of the value function.
void decreaseRegularization () override
 Decrease the state and control regularization values by a regfactor_ factor.
bool decreaseRegularizationCriteria () override
 Criteria used to decrease regularization.
virtual Vector3s expectedImprovement () override
 Return the expected improvement $dV_{exp}$ from a given current search direction $(\delta\mathbf{x}^k,\delta\mathbf{u}^k)$.
virtual void feasShootForwardPass (const Scalar steplength)
 Run the feasibility-driven nonlinear rollout.
void forwardPass (const Scalar steplength=Scalar(1.))
 Perform a forward pass with a predefined step length.
const VectorXs & get_beta_plus () const
 Return the next terminal-constraint multiplier $\boldsymbol{\beta}^+$.
const MatrixXs & get_dHc () const
 Return the Jacobian of the terminal constraint gains $\delta\mathbf{H}_{c}$.
const std::vector< MatrixXs > & get_dUc () const
 Return the linear update in $\delta\mathbf{U}_{c_s}$.
const std::vector< MatrixXs > & get_dXc () const
 Return the linear update in $\delta\mathbf{X}_{c_s}$.
DynamicsSolverType get_dynamics_solver () const
 Return the type of solver used for handling the dynamics constraints.
const VectorXs & get_hc () const
 Return the bias term of the terminal constraint gains $\mathbf{h}_{c}$.
const std::vector< MatrixXsRowMajor > & get_K () const
 Return the feedback gains $\mathbf{K}_{s}$.
const std::vector< VectorXs > & get_k () const
 Return the feedforward gains $\mathbf{k}_{s}$.
const std::vector< MatrixXs > & get_Kc () const
 Return the feedforward gains $\mathbf{K}_{c_s}$.
const std::vector< VectorXs > & get_Qu () const
 Return the Jacobian of the Hamiltonian function $\mathbf{Q}_{\mathbf{u}_s}$.
const std::vector< MatrixXs > & get_Quc () const
 Return the Hessian of the Hamiltonian function $\mathbf{Q}_{\mathbf{uc}_s}$.
const std::vector< MatrixXs > & get_Quu () const
 Return the Hessian of the Hamiltonian function $\mathbf{Q}_{\mathbf{uu}_s}$.
const std::vector< VectorXs > & get_Qx () const
 Return the Jacobian of the Hamiltonian function $\mathbf{Q}_{\mathbf{x}_s}$.
const std::vector< MatrixXs > & get_Qxc () const
 Return the Hessian of the Hamiltonian function $\mathbf{Q}_{\mathbf{xc}_s}$.
const std::vector< MatrixXs > & get_Qxu () const
 Return the Hessian of the Hamiltonian function $\mathbf{Q}_{\mathbf{xu}_s}$.
const std::vector< MatrixXs > & get_Qxx () const
 Return the Hessian of the Hamiltonian function $\mathbf{Q}_{\mathbf{xx}_s}$.
Scalar get_reg_decfactor () const
 Return the regularization factor used to decrease the damping value.
Scalar get_reg_incfactor () const
 Return the regularization factor used to increase the damping value.
Scalar get_rho () const
 Return the rho parameter used in the merit function.
EqualitySolverType get_terminal_solver () const
 Return the type of solver used for handling the terminal constraints.
Scalar get_th_acceptminstep () const
 Return the threshold used for accepting minimum steps.
Scalar get_th_acceptnegstep () const
 Return the threshold used for accepting step along ascent direction.
Scalar get_th_grad () const
 Return the tolerance of the expected gradient used for testing the step.
Scalar get_th_minfeas () const
 Return the threshold for switching to feasibility.
Scalar get_th_minimprove () const
 Return the minimum improvement threshold used to increase regularization.
Scalar get_th_stepdec () const
 Return the step-length threshold used to decrease regularization.
Scalar get_th_stepinc () const
 Return the step-length threshold used to increase regularization.
const std::vector< std::size_t > & get_Ts () const
 Return the hybrid shooting intervals.
Scalar get_upsilon () const
 Return the estimated penalty parameter that balances relative contribution of the cost function and equality constraints.
Scalar get_upsilon_decfactor () const
 Return the upsilon decresing factor used to estimate to balance optimality and feasibility.
const std::vector< VectorXs > & get_Vx () const
 Return the Hessian of the Value function $V_{\mathbf{x}_s}$.
const std::vector< MatrixXs > & get_Vxc () const
 Return the Hessian of the Value function $V_{\mathbf{xc}_s}$.
const std::vector< MatrixXs > & get_Vxx () const
 Return the Hessian of the Value function $V_{\mathbf{xx}_s}$.
bool get_zero_upsilon () const
 Return the zero-upsilon label.
virtual void hybridShootForwardPass (const Scalar steplength)
 Run the multiple-shooting rollout with intervals of feasibility-driven search.
void increaseRegularization () override
 Increase the state and control regularization values by a regfactor_ factor.
bool increaseRegularizationCriteria () override
 Criteria used to increase regularization.
void linearRollout ()
 Perform a linear rollout give the current control policy.
virtual void multiShootForwardPass (const Scalar steplength)
 Run the multiple-shooting rollout.
virtual void resizeData ()
 Resizing the solver data.
void set_dynamics_solver (const DynamicsSolverType type, const std::size_t Tshoot=0)
 Set the dynamic solver used for handling the dynamics constraints.
void set_reg_decfactor (const Scalar reg_factor)
 Modify the regularization factor used to decrease the damping value.
void set_reg_incfactor (const Scalar reg_factor)
 Modify the regularization factor used to increase the damping value.
void set_rho (const Scalar rho)
 Modify the rho parameter used in the merit function.
void set_terminal_solver (const EqualitySolverType type)
 Set the type of solver used for handling the terminal constraints.
void set_th_acceptminstep (const Scalar th_acceptminstep)
 Modify the threshold used for accepting minimum steps.
void set_th_acceptnegstep (const Scalar th_acceptnegstep)
 Modify the threshold used for accepting step along ascent direction.
void set_th_grad (const Scalar th_grad)
 Modify the tolerance of the expected gradient used for testing the step.
void set_th_minfeas (const Scalar th_minfeas)
 Modify the threshold for switching to feasibility.
void set_th_minimprove (const Scalar th_step)
 Modify the minimum improvement threshold used to increase regularization.
void set_th_noimprovement (const Scalar th_noimprovement)
 Modify the threshold used to accept steps that cannot be be improved due to numerical errors the th noimprovement object.
void set_th_stepdec (const Scalar th_step)
 Modify the step-length threshold used to decrease regularization.
void set_th_stepinc (const Scalar th_step)
 Modify the step-length threshold used to increase regularization.
void set_upsilon_decfactor (const Scalar th_step)
 Modify the upsilon decresing factor used to estimate to balance optimality and feasibility.
void set_zero_upsilon (const bool zero_upsilon)
 Modify the zero-upsilon label.
virtual void singleShootForwardPass (const Scalar steplength)
 Run the classical nonlinear rollout.
virtual Scalar stoppingCriteria () override
 Return a positive value that quantifies the algorithm termination.
void updateCandidate () override
 Update the candidate solution: cost, feasibilities, and merit value.
void updateDir ()
 Update search direction associated with the batch's constraints.
virtual void updateDualsAndSlacks (const Scalar stepLength=Scalar(1.))
 Update the dual and slack variables with a predefined step length.
virtual void updateMeritFunction () override
 Update the merit function value for the current guess.
Public Member Functions inherited from SolverAbstractTpl< _Scalar >
 SolverAbstractTpl (std::shared_ptr< ShootingProblem > problem)
 Initialize the solver.
virtual void calcDir ()
 Refresh the linearization of the optimal control problem around the current candidate.
Scalar computeControlFeasibility (const std::vector< VectorXs > &us)
 Compute the control box-constraint feasibility from a given control trajectory.
Scalar computeDynamicFeasibility ()
 Compute the dynamic feasibility $\|\mathbf{f}_{\mathbf{s}}\|_{\infty,1}$ for the current guess $(\mathbf{x}^k,\mathbf{u}^k)$.
Scalar computeEqualityFeasibility ()
 Compute the feasibility of the equality constraints for the current guess.
Scalar computeFeasibility (const std::vector< VectorXs > &fs)
 Compute the feasibility from a given residual vector.
Scalar computeInequalityFeasibility ()
 Compute the feasibility of the inequality constraints for the current guess.
Scalar computeStateFeasibility (const std::vector< VectorXs > &xs)
 Compute the state box-constraint feasibility from a given state trajectory.
 DEPRECATED ("Do not use this threshold. It is not needed by our solvers", Scalar get_th_gaptol() const { return th_gaptol_;}) FeasibilityNorm get_feasnorm() const
 Return the threshold for accepting a gap as non-zero.
 DEPRECATED ("Do not use this threshold. It is not needed by our solvers", void set_th_gaptol(const Scalar th_gaptol);) void set_feasnorm(const FeasibilityNorm feas_norm)
 Modify the threshold for accepting a gap as non-zero.
 DEPRECATED ("Use get_preg for primal-variable regularization", Scalar get_xreg() const { return preg_;}) DEPRECATED("Use get_preg for primal-variable regularization"
 DEPRECATED ("Use set_preg for primal-variable regularization", void set_xreg(const Scalar xreg) { if(xreg< Scalar(0.)) { throw_pretty("Invalid argument: "<< "xreg value has to be positive.");} xreg_=xreg;preg_=xreg;}) DEPRECATED("Use set_preg for primal-variable regularization"
const std::vector< Scalar > & get_alphas () const
 Return the set of step lengths using by the line-search procedure.
Scalar get_cost () const
 Return the cost for the current guess.
Scalar get_dfeas () const
 Return the reduction in the feasibility.
Scalar get_dPhi () const
 Return the reduction in the merit function $\Delta\Phi$.
Scalar get_dPhiexp () const
 Return the expected reduction in the merit function $\Delta\Phi_{exp}$.
Scalar get_dreg () const
 Return the dual-variable regularization.
const std::vector< VectorXs > & get_dus () const
 Return the feedforward gains $\delta\mathbf{u}_s$.
const Vector3s & get_DV () const
 Return the constant, linear, and quadratic terms of the expected improvement.
Scalar get_dV () const
 Return the reduction in the cost function $\Delta V$.
Scalar get_dVexp () const
 Return the expected reduction in the cost function $\Delta
V_{exp}$.
const std::vector< VectorXs > & get_dxs () const
 Return the linear update in $\delta\mathbf{x}_s$.
Scalar get_feas () const
 Return the total feasibility for the current guess.
Scalar get_ffeas () const
 Return the dynamic feasibility for the current guess.
Scalar get_ffeas_try () const
 Return the dynamic feasibility for the current step length.
const std::vector< VectorXs > & get_fs () const
 Return the dynamic infeasibility $\mathbf{f}_{s}$.
const std::vector< VectorXs > & get_fs_try () const
 Return the trail dynamic infeasibility $\mathbf{f}_{s}$.
Scalar get_gfeas () const
 Return the inequality feasibility for the current guess.
Scalar get_gfeas_try () const
 Return the inequality feasibility for the current step length.
Scalar get_hfeas () const
 Return the equality feasibility for the current guess.
Scalar get_hfeas_try () const
 Return the equality feasibility for the current step length.
bool get_is_feasible () const
 Return the feasibility status of the $(\mathbf{x}_s,\mathbf{u}_s)$ trajectory.
std::size_t get_iter () const
 Return the number of iterations performed by the solver.
Scalar get_merit () const
 Return the merit for the current guess.
Scalar get_preg () const
 Return the primal-variable regularization.
const std::shared_ptr< ShootingProblem > & get_problem () const
 Return the shooting problem.
Scalar get_reg_max () const
 Return the maximum regularization value.
Scalar get_reg_min () const
 Return the minimum regularization value.
Scalar get_steplength () const
 Return the step length $\alpha$.
Scalar get_stop () const
 Return the stopping-criteria value computed by stoppingCriteria().
Scalar get_th_acceptstep () const
 Return the threshold used for accepting a step.
Scalar get_th_stop () const
 Return the tolerance for stopping the algorithm.
Scalar get_ureg () const
const std::vector< VectorXs > & get_us () const
 Return the control trajectory $\mathbf{u}_s$.
const std::vector< VectorXs > & get_us_try () const
 Return the trial control trajectory $\mathbf{u}_s$.
const std::vector< VectorXs > & get_xs () const
 Return the state trajectory $\mathbf{x}_s$.
const std::vector< VectorXs > & get_xs_try () const
 Return the trial state trajectory $\mathbf{x}_s$.
const std::vector< std::shared_ptr< CallbackAbstract > > & getCallbacks () const
 Return the list of callback functions using for diagnostic.
void set_alphas (const std::vector< Scalar > &alphas)
 Modify the set of step lengths using by the line-search procedure.
void set_dreg (const Scalar dreg)
 Modify the dual-variable regularization value.
void set_preg (const Scalar preg)
 Modify the primal-variable regularization value.
void set_reg_max (const Scalar regmax)
 Modify the maximum regularization value.
void set_reg_min (const Scalar regmin)
 Modify the minimum regularization value.
void set_th_acceptstep (const Scalar th_acceptstep)
 Modify the threshold used for accepting step.
void set_th_stop (const Scalar th_stop)
 Modify the tolerance for stopping the algorithm.
void set_ureg (const Scalar ureg)
void set_us (const std::vector< VectorXs > &us)
 Modify the control trajectory $\mathbf{u}_s$.
void set_xs (const std::vector< VectorXs > &xs)
 Modify the state trajectory $\mathbf{x}_s$.
void setCallbacks (const std::vector< std::shared_ptr< CallbackAbstract > > &callbacks)
 Set a list of callback functions using for the solver diagnostic.
virtual void setCandidate (const std::vector< VectorXs > &xs_warm=DefaultVector< Scalar >::value, const std::vector< VectorXs > &us_warm=DefaultVector< Scalar >::value, const bool is_feasible=false)
 Set the solver candidate trajectories $(\mathbf{x}_s,\mathbf{u}_s)$.
virtual bool solve (const std::vector< VectorXs > &init_xs=DefaultVector< Scalar >::value, const std::vector< VectorXs > &init_us=DefaultVector< Scalar >::value, const std::size_t maxiter=100, const bool is_feasible=false, const Scalar reg_init=std::numeric_limits< Scalar >::quiet_NaN())
 Compute the optimal trajectory $\mathbf{x}^*_s,\mathbf{u}^*_s$ as lists of $T+1$ and $T$ terms.
virtual Scalar tryStep (const Scalar steplength=Scalar(1.))
 Try a predefined step length $\alpha$ and compute its cost improvement $dV$ and merit improvement $d\Phi$.

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
Public Attributes inherited from SolverFDDPTpl< _Scalar >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
Public Attributes inherited from SolverAbstractTpl< _Scalar >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Protected Member Functions

void allocateData ()
virtual void resizeRunningData () override
 Resize data associated with the running models of the shooting problem.
Protected Member Functions inherited from SolverFDDPTpl< _Scalar >
void allocateData ()
 Allocate all the internal data needed for the solver.
void computeNullTerminalMultiplier ()
 compute the multiplier associated to the terminal constraint
virtual void resizeTerminalData () override
 Resize data associated with the terminal model of the shooting problem.
Protected Member Functions inherited from SolverAbstractTpl< _Scalar >
void allocateData ()
 Allocate all the basic data needed in solvers.
 DEPRECATED ("Do not use this threshold. It is not needed by our solvers", Scalar th_gaptol_;) enum FeasibilityNorm feasnorm_
 DEPRECATED ("Use preg_ for primal-variable regularization", Scalar xreg_;) DEPRECATED("Use dreg_ for primal-variable regularization"

Protected Attributes

std::vector< VectorXs > du_lb_
std::vector< VectorXs > du_ub_
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}$.
BoxQP qp_
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 > Quu_inv_
std::vector< MatrixXs > Qxu_
 Hessian of the Hamiltonian $\mathbf{Q_{xu}}$.
Scalar reg_decfactor_
Scalar reg_incfactor_
Scalar rho_
EqualitySolverType term_solver_
 Type of terminal solver.
Scalar th_acceptminstep_
Scalar th_acceptnegstep_
Scalar th_grad_
Scalar th_minfeas_
 Threshold for switching to feasibility.
Scalar th_minimprove_
Scalar th_noimprovement_
Scalar th_stepdec_
 Step-length threshold used to decrease regularization.
Scalar th_stepinc_
 Step-length threshold used to increase regularization.
Scalar upsilon_decfactor_
std::vector< VectorXs > Vx_
 Gradient of the Value function $\mathbf{V_x}$.
std::vector< MatrixXs > Vxx_
 Hessian of the Value function $\mathbf{V_{xx}}$.
VectorXs xnext_
 Next state $\mathbf{x}^{'}$.
bool zero_upsilon_
Protected Attributes inherited from SolverFDDPTpl< _Scalar >
std::vector< VectorXs > dx_
 State error during the roll-out/forward-pass (size T).
DynamicsSolverType dyn_solver_
 Type of dynamics solver.
VectorXs fTVxx_p_
std::vector< MatrixXsRowMajor > FuTVxx_p_
std::vector< MatrixXsRowMajor > FxTVxx_p_
std::vector< MatrixXsRowMajor > K_
 Feedback gains $\mathbf{K}$.
std::vector< VectorXs > k_
 Feed-forward terms $\mathbf{l}$.
std::vector< VectorXs > Luu_du_
std::vector< VectorXs > Lxu_du_
std::vector< VectorXs > Lxx_dx_
std::vector< VectorXs > Qu_
 Gradient of the Hamiltonian $\mathbf{Q_u}$.
std::vector< MatrixXs > Quu_
 Hessian of the Hamiltonian $\mathbf{Q_{uu}}$.
std::vector< Eigen::LLT< MatrixXs > > Quu_llt_
 Cholesky LLT solver.
std::vector< VectorXs > Qx_
 Gradient of the Hamiltonian $\mathbf{Q_x}$.
std::vector< MatrixXs > Qxu_
 Hessian of the Hamiltonian $\mathbf{Q_{xu}}$.
std::vector< MatrixXs > Qxx_
 Hessian of the Hamiltonian $\mathbf{Q_{xx}}$.
Scalar reg_decfactor_
Scalar reg_incfactor_
Scalar rho_
EqualitySolverType term_solver_
 Type of terminal solver.
Scalar th_acceptminstep_
Scalar th_acceptnegstep_
Scalar th_grad_
Scalar th_minfeas_
 Threshold for switching to feasibility.
Scalar th_minimprove_
Scalar th_noimprovement_
Scalar th_stepdec_
 Step-length threshold used to decrease regularization.
Scalar th_stepinc_
 Step-length threshold used to increase regularization.
std::vector< std::size_t > Ts_
 Index that describes the hybrid shoots.
Scalar upsilon_
Scalar upsilon_decfactor_
std::vector< VectorXs > Vx_
 Gradient of the Value function $\mathbf{V_x}$.
std::vector< MatrixXs > Vxx_
 Hessian of the Value function $\mathbf{V_{xx}}$.
std::vector< VectorXs > Vxx_f_
MatrixXs Vxx_tmp_
 Temporary variable for ensuring symmetry of Vxx.
bool zero_upsilon_
Protected Attributes inherited from SolverAbstractTpl< _Scalar >
bool acceptstep_
std::vector< Scalar > alphas_
 Set of step lengths using by the line-search procedure.
std::vector< std::shared_ptr< CallbackAbstract > > callbacks_
 Callback functions.
Scalar cost_
 Cost for the current guess.
Scalar cost_try_
 Total cost computed by line-search procedure.
Scalar dfeas_
 Reduction in the feasibility.
Scalar dImpr_
Scalar dPhi_
 Reduction in the merit function computed by tryStep().
Scalar dPhiexp_
Scalar dreg_
 Current dual-variable regularization value.
std::vector< VectorXs > dus_
 Linear control direction (size T).
Vector3s DV_
 LQ approximation of the expected improvement.
Scalar dV_
 Reduction in the cost function computed by tryStep().
Scalar dVexp_
Scalar dVexp_full_
std::vector< VectorXs > dxs_
 Linear state direction (size T + 1).
Scalar feas_
 Total feasibility for the current guess.
Scalar ffeas_
 Feasibility of the dynamic constraints for the current guess.
Scalar ffeas_try_
std::vector< VectorXs > fs_
 Dynamics gaps in each node.
std::vector< VectorXs > fs_try_
std::vector< VectorXs > g_adj_
 Adjusted inequality bound.
Scalar gfeas_
Scalar gfeas_try_
Scalar hfeas_
Scalar hfeas_try_
bool is_feasible_
 Label that indicates is the iteration is feasible.
std::size_t iter_
 Number of iteration performed by the solver.
Scalar merit_
 Merit for the current guess.
std::size_t ng_T_
 Dimension of termianl inequality constraints.
std::size_t nh_T_
 Dimension of terminal equality constraints.
Scalar preg_
 Current primal-variable regularization value.
std::shared_ptr< ShootingProblem > problem_
 optimal control problem
bool recalcdir_
Scalar reg_max_
 Maximum allowed regularization value.
Scalar reg_min_
 < Current control regularization values
Scalar steplength_
 Current applied step length.
Scalar stop_
 Value computed by stoppingCriteria().
Scalar th_acceptstep_
 Threshold used for accepting step.
Scalar th_stop_
 Tolerance for stopping the algorithm.
Scalar tmp_feas_
 Temporal variables used for computed the feasibility.
std::vector< VectorXs > u_adj_
 Adjusted control bound.
Scalar ureg_
std::vector< VectorXs > us_
 Control trajectory.
std::vector< VectorXs > us_try_
 Control trajectory computed by line-search procedure.
bool was_feasible_
std::vector< VectorXs > x_adj_
 Adjusted state bound.
std::vector< VectorXs > xs_
 State trajectory.
std::vector< VectorXs > xs_try_
 State trajectory computed by line-search procedure.

Detailed Description

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

Definition at line 18 of file box-fddp.hpp.

Member Typedef Documentation

◆ SolverFDDP

template<typename _Scalar>
typedef SolverFDDPTpl<Scalar> SolverFDDP

Definition at line 24 of file box-fddp.hpp.

◆ BoxQP

template<typename _Scalar>
typedef BoxQPTpl<Scalar> BoxQP

Definition at line 25 of file box-fddp.hpp.

◆ BoxQPSolution

template<typename _Scalar>
typedef BoxQPSolutionTpl<Scalar> BoxQPSolution

Definition at line 26 of file box-fddp.hpp.

◆ ShootingProblem

template<typename _Scalar>
typedef ShootingProblemTpl<Scalar> ShootingProblem

Definition at line 27 of file box-fddp.hpp.

◆ ActionModelAbstract

template<typename _Scalar>
typedef ShootingProblem::ActionModelAbstract ActionModelAbstract

Definition at line 28 of file box-fddp.hpp.

◆ ActionDataAbstract

template<typename _Scalar>
typedef ShootingProblem::ActionDataAbstract ActionDataAbstract

Definition at line 29 of file box-fddp.hpp.

◆ MathBase

template<typename _Scalar>
typedef MathBaseTpl<Scalar> MathBase

Definition at line 30 of file box-fddp.hpp.

◆ VectorXs

template<typename _Scalar>
typedef MathBase::VectorXs VectorXs

Definition at line 31 of file box-fddp.hpp.

◆ MatrixXs

template<typename _Scalar>
typedef MathBase::MatrixXs MatrixXs

Definition at line 32 of file box-fddp.hpp.

Member Function Documentation

◆ computePolicy()

template<typename _Scalar>
virtual void computePolicy(const std::size_tt)
overridevirtual

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{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}

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

Reimplemented from SolverFDDPTpl< _Scalar >.

◆ cast()

template<typename _Scalar>
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
NewScalarThe new scalar type to cast to.
Returns
SolverBoxFDDPTpl<NewScalar> An Box-FDDP solver with the new scalar type.

◆ resizeRunningData()

template<typename _Scalar>
virtual void resizeRunningData()
overrideprotectedvirtual

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

Reimplemented from SolverFDDPTpl< _Scalar >.

Member Data Documentation

◆ Scalar

template<typename _Scalar>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Definition at line 23 of file box-fddp.hpp.

◆ qp_

template<typename _Scalar>
BoxQP qp_
protected

Definition at line 97 of file box-fddp.hpp.

◆ Quu_inv_

template<typename _Scalar>
std::vector<MatrixXs> Quu_inv_
protected

Definition at line 98 of file box-fddp.hpp.

◆ du_lb_

template<typename _Scalar>
std::vector<VectorXs> du_lb_
protected

Definition at line 99 of file box-fddp.hpp.

◆ du_ub_

template<typename _Scalar>
std::vector<VectorXs> du_ub_
protected

Definition at line 100 of file box-fddp.hpp.

◆ xnext_

template<typename _Scalar>
VectorXs xnext_
protected

Next state $\mathbf{x}^{'}$.

Definition at line 101 of file box-fddp.hpp.

◆ dx_

template<typename _Scalar>
std::vector<VectorXs> dx_
protected

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

Definition at line 748 of file fddp.hpp.

◆ dyn_solver_

template<typename _Scalar>
DynamicsSolverType dyn_solver_
protected

Type of dynamics solver.

Definition at line 685 of file fddp.hpp.

◆ K_

template<typename _Scalar>
std::vector<MatrixXsRowMajor> K_
protected

Feedback gains $\mathbf{K}$.

Definition at line 745 of file fddp.hpp.

◆ k_

template<typename _Scalar>
std::vector<VectorXs> k_
protected

Feed-forward terms $\mathbf{l}$.

Definition at line 746 of file fddp.hpp.

◆ Qu_

template<typename _Scalar>
std::vector<VectorXs> Qu_
protected

Gradient of the Hamiltonian $\mathbf{Q_u}$.

Definition at line 744 of file fddp.hpp.

◆ Quu_

template<typename _Scalar>
std::vector<MatrixXs> Quu_
protected

Hessian of the Hamiltonian $\mathbf{Q_{uu}}$.

Definition at line 740 of file fddp.hpp.

◆ Qxu_

template<typename _Scalar>
std::vector<MatrixXs> Qxu_
protected

Hessian of the Hamiltonian $\mathbf{Q_{xu}}$.

Definition at line 738 of file fddp.hpp.

◆ reg_decfactor_

template<typename _Scalar>
Scalar reg_decfactor_
protected

Regularization factor used to decrease the damping value

Definition at line 689 of file fddp.hpp.

◆ reg_incfactor_

template<typename _Scalar>
Scalar reg_incfactor_
protected

Regularization factor used to increase the damping value

Definition at line 687 of file fddp.hpp.

◆ rho_

template<typename _Scalar>
Scalar rho_
protected

Parameter used in the merit function to predict the expected reduction

Definition at line 705 of file fddp.hpp.

◆ term_solver_

template<typename _Scalar>
EqualitySolverType term_solver_
protected

Type of terminal solver.

Definition at line 686 of file fddp.hpp.

◆ th_acceptminstep_

template<typename _Scalar>
Scalar th_acceptminstep_
protected

Threshold used for accepting step along with a minimum length

Definition at line 703 of file fddp.hpp.

◆ th_acceptnegstep_

template<typename _Scalar>
Scalar th_acceptnegstep_
protected

Threshold used for accepting step along ascent direction

Definition at line 701 of file fddp.hpp.

◆ th_grad_

template<typename _Scalar>
Scalar th_grad_
protected

Tolerance of the expected gradient used for testing the step

Definition at line 691 of file fddp.hpp.

◆ th_minfeas_

template<typename _Scalar>
Scalar th_minfeas_
protected

Threshold for switching to feasibility.

Definition at line 707 of file fddp.hpp.

◆ th_minimprove_

template<typename _Scalar>
Scalar th_minimprove_
protected

Minimum improvement threshold used in the regularization scheme

Definition at line 699 of file fddp.hpp.

◆ th_noimprovement_

template<typename _Scalar>
Scalar th_noimprovement_
protected

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

Definition at line 693 of file fddp.hpp.

◆ th_stepdec_

template<typename _Scalar>
Scalar th_stepdec_
protected

Step-length threshold used to decrease regularization.

Definition at line 696 of file fddp.hpp.

◆ th_stepinc_

template<typename _Scalar>
Scalar th_stepinc_
protected

Step-length threshold used to increase regularization.

Definition at line 698 of file fddp.hpp.

◆ upsilon_decfactor_

template<typename _Scalar>
Scalar upsilon_decfactor_
protected

Estimated penalty parameter factor used to decrease its value

Definition at line 711 of file fddp.hpp.

◆ Vx_

template<typename _Scalar>
std::vector<VectorXs> Vx_
protected

Gradient of the Value function $\mathbf{V_x}$.

Definition at line 725 of file fddp.hpp.

◆ Vxx_

template<typename _Scalar>
std::vector<MatrixXs> Vxx_
protected

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

Definition at line 720 of file fddp.hpp.

◆ zero_upsilon_

template<typename _Scalar>
bool zero_upsilon_
protected

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

Definition at line 713 of file fddp.hpp.


The documentation for this class was generated from the following files:
  • /build/source/include/crocoddyl/core/fwd.hpp
  • /build/source/include/crocoddyl/core/solvers/box-fddp.hpp