SolverIntroTpl (std::shared_ptr< ShootingProblem > problem, const DynamicsSolverType dyn_solver=FeasShoot, const EqualitySolverType eq_solver=LuNull, const EqualitySolverType term_solver=LuNull) Initialize the INTRO solver. virtual void calcDir () override Refresh the Intro linearization and constraint factorizations. template<typename NewScalar> SolverIntroTpl < NewScalar > cast () const Cast the Intro solver to a different scalar type. virtual void computeBatchPolicy (const std::size_t t) override Compute the feedforward and feedback terms (control policy) associated to the batch's constraints. virtual void computeBatchValueFunction (const std::size_t t) override Compute the linear-quadratic approximation of the value function associated to the batch's constraints. virtual void computeDirection (const bool recalc=true) override Compute the search direction for the current guess . virtual void computePolicy (const std::size_t t) override 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) override Compute the linear-quadratic approximation of the value function. EqualitySolverType get_equality_solver () const Return the type of solver used for handling the equality constraints. 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 computeCandidate (const Scalar step_length=Scalar(1.)) override Compute new candidate solution using step length. Scalar computeDynamicFeasibility () Compute the dynamic feasibility for the current guess . 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. 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 from a given current search direction . 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. SolverAbstractTpl (std::shared_ptr< ShootingProblem > problem) Initialize the solver. Scalar computeControlFeasibility (const std::vector< VectorXs > &us) Compute the control box-constraint feasibility from a given control trajectory. Scalar computeDynamicFeasibility () Compute the dynamic feasibility for the current guess . 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 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 . 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 () constconst 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 as lists of and terms. virtual Scalar tryStep (const Scalar steplength=Scalar(1.)) Try a predefined step length and compute its cost improvement and merit improvement .