Feasibility-driven Differential Dynamic Programming (FDDP) solver. More...
#include <fddp.hpp>
Public Types | |
| 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 | |
| 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 | |
| Scalar | computeDynamicFeasibility () |
| Compute the dynamic feasibility | |
| 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 | computePolicy (const std::size_t t) |
| Compute the feedforward and feedback terms (control policy) computed via a Cholesky decomposition. | |
| 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 | |
| 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 | |
| const MatrixXs & | get_dHc () const |
| Return the Jacobian of the terminal constraint gains | |
| const std::vector< MatrixXs > & | get_dUc () const |
| Return the linear update in | |
| const std::vector< MatrixXs > & | get_dXc () const |
| Return the linear update in | |
| 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 | |
| const std::vector< MatrixXsRowMajor > & | get_K () const |
| Return the feedback gains | |
| const std::vector< VectorXs > & | get_k () const |
| Return the feedforward gains | |
| const std::vector< MatrixXs > & | get_Kc () const |
| Return the feedforward gains | |
| const std::vector< VectorXs > & | get_Qu () const |
| Return the Jacobian of the Hamiltonian function | |
| const std::vector< MatrixXs > & | get_Quc () const |
| Return the Hessian of the Hamiltonian function | |
| const std::vector< MatrixXs > & | get_Quu () const |
| Return the Hessian of the Hamiltonian function | |
| const std::vector< VectorXs > & | get_Qx () const |
| Return the Jacobian of the Hamiltonian function | |
| const std::vector< MatrixXs > & | get_Qxc () const |
| Return the Hessian of the Hamiltonian function | |
| const std::vector< MatrixXs > & | get_Qxu () const |
| Return the Hessian of the Hamiltonian function | |
| const std::vector< MatrixXs > & | get_Qxx () const |
| Return the Hessian of the Hamiltonian function | |
| 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 | |
| const std::vector< MatrixXs > & | get_Vxc () const |
| Return the Hessian of the Value function | |
| const std::vector< MatrixXs > & | get_Vxx () const |
| Return the Hessian of the Value function | |
| 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 | |
| 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 | |
| Scalar | get_dPhiexp () const |
| Return the expected reduction in the merit function | |
| Scalar | get_dreg () const |
| Return the dual-variable regularization. | |
| const std::vector< VectorXs > & | get_dus () const |
| Return the feedforward gains | |
| 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 | |
| Scalar | get_dVexp () const |
| Return the expected reduction in the cost function | |
| const std::vector< VectorXs > & | get_dxs () const |
| Return the linear update in | |
| 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 | |
| const std::vector< VectorXs > & | get_fs_try () const |
| Return the trail dynamic infeasibility | |
| 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 | |
| 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 | |
| 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 | |
| const std::vector< VectorXs > & | get_us_try () const |
| Return the trial control trajectory | |
| const std::vector< VectorXs > & | get_xs () const |
| Return the state trajectory | |
| const std::vector< VectorXs > & | get_xs_try () const |
| Return the trial state trajectory | |
| 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 | |
| void | set_xs (const std::vector< VectorXs > &xs) |
| Modify the state trajectory | |
| 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 | |
| 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 | |
| virtual Scalar | tryStep (const Scalar steplength=Scalar(1.)) |
| Try a predefined step length | |
Public Attributes | |
| 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 () |
| Allocate all the internal data needed for the solver. | |
| void | computeNullTerminalMultiplier () |
| compute the multiplier associated to the terminal constraint | |
| virtual void | resizeRunningData () override |
| Resize data associated with the running models of the shooting problem. | |
| 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 > | 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 | |
| std::vector< VectorXs > | k_ |
| Feed-forward terms | |
| std::vector< VectorXs > | Luu_du_ |
| std::vector< VectorXs > | Lxu_du_ |
| std::vector< VectorXs > | Lxx_dx_ |
| std::vector< VectorXs > | Qu_ |
| Gradient of the Hamiltonian | |
| std::vector< MatrixXs > | Quu_ |
| Hessian of the Hamiltonian | |
| std::vector< Eigen::LLT< MatrixXs > > | Quu_llt_ |
| Cholesky LLT solver. | |
| std::vector< VectorXs > | Qx_ |
| Gradient of the Hamiltonian | |
| std::vector< MatrixXs > | Qxu_ |
| Hessian of the Hamiltonian | |
| std::vector< MatrixXs > | Qxx_ |
| Hessian of the Hamiltonian | |
| 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 | |
| std::vector< MatrixXs > | Vxx_ |
| Hessian of the Value function | |
| 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. | |
Feasibility-driven Differential Dynamic Programming (FDDP) solver.
The FDDP solver computes an optimal trajectory and control commands by iterates running backwardPass() and forwardPass(). The backward pass accepts infeasible guess as described in the SolverFDDP::backwardPass(). Additionally, the forward pass handles infeasibility simulations that resembles the numerical behaviour of a multiple-shooting formulation, i.e.:

Note that the forward pass keeps the gaps 


with

For more details about the feasibility-driven differential dynamic programming algorithm see:
| typedef SolverAbstractTpl<Scalar> SolverAbstract |
| typedef ShootingProblemTpl<Scalar> ShootingProblem |
| typedef ShootingProblem::ActionModelAbstract ActionModelAbstract |
| typedef ShootingProblem::ActionDataAbstract ActionDataAbstract |
| typedef CallbackAbstractTpl<Scalar> CallbackAbstract |
| typedef MathBaseTpl<Scalar> MathBase |
| typedef MathBase::VectorXs VectorXs |
| typedef MathBase::Vector3s Vector3s |
| typedef MathBase::MatrixXs MatrixXs |
| typedef MathBase::MatrixXsRowMajor MatrixXsRowMajor |
| explicit |
Initialize the FDDP solver.
| [in] | problem | Shooting problem |
| [in] | dyn_solver | Type of dynamic solver |
| [in] | term_solver | Type of terminal solver |
| overridevirtual |
Compute the search direction 

Implements SolverAbstractTpl< _Scalar >.
Reimplemented in SolverIntroTpl< _Scalar >, and SolverIntroTpl< double >.
| overridevirtual |
Compute new candidate solution using step length.
Reimplemented from SolverAbstractTpl< _Scalar >.
| void forwardPass | ( | const Scalar | steplength = Scalar(1.) | ) |
Perform a forward pass with a predefined step length.
Our solver supports fourth type of forward passes: feasiblility-driven (FeasShoot), multiple shooting (MultiShoot), hybrid shooting (HybridShoot), and single shooting (SingleShoot). The feasibility-driven shooting decreases monotonocally the dynamics feasibility based on the applied step length. The hybrid shooting combines both feasibility-driven and multiple shooting approaches. Instead, the single shooting is the traditional approach implemented in DDP. The type of dynamics solver can be defined via set_dynamics_solver.
| [in] | steplength | applied step length ( |
| virtual |
Update the dual and slack variables with a predefined step length.
| [in] | steplength | applied step length ( |
| overridevirtual |
Return a positive value that quantifies the algorithm termination.
Implements SolverAbstractTpl< _Scalar >.
| overridevirtual |
Return the expected improvement 

The expected improvement computation considers the gaps in the dynamics:

with

Implements SolverAbstractTpl< _Scalar >.
| overridevirtual |
Compute the merit function improvement for the current step.
Reimplemented from SolverAbstractTpl< _Scalar >.
| overridevirtual |
Compute the expected merit function improvement for the current step.
Reimplemented from SolverAbstractTpl< _Scalar >.
| overridevirtual |
Update the merit function value for the current guess.
Reimplemented from SolverAbstractTpl< _Scalar >.
| overridevirtual |
Check if we should accept or not the step.
Reimplemented from SolverAbstractTpl< _Scalar >.
| virtual |
Run the backward pass (Riccati sweep).
It assumes that the Jacobian and Hessians of the optimal control problem have been compute (i.e., calcDir()). The backward pass handles infeasible guess through a modified Riccati sweep:

where 









| void batchPass | ( | ) |
Run the batch pass to account for its constraints.
Update the direction and feed-forward term to account for the terminal constraint. To do so, we first compute the unscaled search direction accounting for the terminal constraint.
| virtual |
Compute the linear-quadratic approximation of the control action-value function.
| [in] | t | Time instance |
| [in] | model | Action model in the given time instance |
| [in] | data | Action data in the given time instance |
| virtual |
Compute the linear-quadratic approximation of the control action-value function associated to the batch's constraints.
| [in] | t | Time instance |
| [in] | data | Action data in the given time instance |
| virtual |
Compute the feedforward and feedback terms (control policy) computed via a Cholesky decomposition.
To compute the feedforward 



Note that if the Cholesky decomposition fails, then we re-start the backward pass and increase the state and control regularization values.
Reimplemented in SolverBoxFDDPTpl< _Scalar >, SolverBoxFDDPTpl< double >, SolverIntroTpl< _Scalar >, and SolverIntroTpl< double >.
| virtual |
Compute the feedforward and feedback terms (control policy) associated to the batch's constraints.
Note that if the Cholesky decomposition fails, then we re-start the backward pass and increase the state and control regularization values.
Reimplemented in SolverIntroTpl< _Scalar >, and SolverIntroTpl< double >.
| virtual |
Compute the linear-quadratic approximation of the value function.
This function is called in the backward pass after updating the local action-value and policy functions.
| [in] | t | Time instance |
| [in] | model | Action model in the given time instance |
Reimplemented in SolverIntroTpl< _Scalar >, and SolverIntroTpl< double >.
| virtual |
Compute the linear-quadratic approximation of the value function associated to the batch's constraints.
This function is called in the backward pass after updating the local action-value and policy functions.
| [in] | t | Time instance |
Reimplemented in SolverIntroTpl< _Scalar >, and SolverIntroTpl< double >.
| void linearRollout | ( | ) |
Perform a linear rollout give the current control policy.
The results of this linear rollout are stored in dxs and dus.
| virtual |
Run the feasibility-driven nonlinear rollout.
It rollouts the action model given the feasibility-driven approach described in "Crocoddyl: An Efficient and Versatile Framework for Multi-Contact Optimal Control"
| [in] | steplength | applied step length ( |
| virtual |
Run the multiple-shooting rollout.
It rollouts the action model given the multiple-shooting approach described in (TODO: add paper title)
| [in] | steplength | applied step length ( |
| virtual |
Run the multiple-shooting rollout with intervals of feasibility-driven search.
It rollouts the action model given the hybrid-shooting approach described in (TODO: add paper title)
| [in] | steplength | applied step length ( |
| virtual |
Run the classical nonlinear rollout.
It rollouts the action model given the classical approach in DDP. You can find details in "A second-order gradient method for determining optimal trajectories of non-linear discrete-time systems"
| [in] | steplength | applied step length ( |
| overridevirtual |
Update the candidate solution: cost, feasibilities, and merit value.
Reimplemented from SolverAbstractTpl< _Scalar >.
| overridevirtual |
Criteria used to decrease regularization.
Reimplemented from SolverAbstractTpl< _Scalar >.
| overridevirtual |
Criteria used to increase regularization.
Reimplemented from SolverAbstractTpl< _Scalar >.
| overridevirtual |
Increase the state and control regularization values by a regfactor_ factor.
Reimplemented from SolverAbstractTpl< _Scalar >.
| overridevirtual |
Decrease the state and control regularization values by a regfactor_ factor.
Reimplemented from SolverAbstractTpl< _Scalar >.
Cast the FDDP solver to a different scalar type.
It is useful for operations requiring different precision or scalar types.
| NewScalar | The new scalar type to cast to. |
| bool get_zero_upsilon | ( | ) | const |
Return the zero-upsilon label.
True if we set the estimated penalty parameter (upsilon) to zero when solve is called.
| void set_dynamics_solver | ( | const DynamicsSolverType | type, |
| const std::size_t | Tshoot = 0 ) |
Set the dynamic solver used for handling the dynamics constraints.
It is worth noting that the default solver is the Feasibility-Driven DDP. When we enable parallelization, this strategy is not necessarily the faster one for medium to large systems.
| [in] | type | Type of dynamics solver |
| [in] | Tshoot | Number of nodes per each shooting interval |
| void set_terminal_solver | ( | const EqualitySolverType | type | ) |
Set the type of solver used for handling the terminal constraints.
| [in] | type | Type of terminal solver |
| void set_zero_upsilon | ( | const bool | zero_upsilon | ) |
Modify the zero-upsilon label.
| zero_upsilon | True if we set estimated penalty parameter (upsilon) to zero when solve is called. |
| overrideprotectedvirtual |
Resize data associated with the running models of the shooting problem.
Reimplemented from SolverAbstractTpl< _Scalar >.
Reimplemented in SolverBoxFDDPTpl< _Scalar >, and SolverBoxFDDPTpl< double >.
| overrideprotectedvirtual |
Resize data associated with the terminal model of the shooting problem.
Reimplemented from SolverAbstractTpl< _Scalar >.
| Scalar computeDynamicFeasibility | ( | ) |
Compute the dynamic feasibility 

The feasibility can be computed using different norms (e.g, 




| Scalar computeEqualityFeasibility | ( | ) |
Compute the feasibility of the equality constraints for the current guess.
The feasibility can be computed using different norms (e.g, 


| Scalar computeFeasibility | ( | const std::vector< VectorXs > & | fs | ) |
Compute the feasibility from a given residual vector.
As in the computeDynamicFeasibility, computeInequalityFeasibility or computeEqualityFeasibility, we can compute the feasibility using different norms (e.g, 


| [in] | fs | Vector of residual vectors which we wish to compute the feasibility |
| Scalar computeInequalityFeasibility | ( | ) |
Compute the feasibility of the inequality constraints for the current guess.
The feasibility can be computed using different norms (e.g, 


| virtual |
Resizing the solver data.
If the shooting problem has changed after construction, then this function resizes all the data before starting resolve the problem.
Reimplemented from SolverAbstractTpl< _Scalar >.
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |