Class SolverIpopt

Inheritance Relationships

Base Type

Class Documentation

class SolverIpopt : public crocoddyl::SolverAbstractTpl<Ipopt::Number>

Ipopt solver.

This solver solves the optimal control problem by transcribing with the multiple shooting approach.

See also

solve()

Public Types

typedef SolverAbstractTpl<Scalar> SolverAbstract
typedef ShootingProblemTpl<Scalar> ShootingProblem
typedef IpoptInterfaceTpl<Scalar> IpoptInterface
typedef MathBaseTpl<Scalar> MathBase
typedef MathBase::VectorXs VectorXs
typedef MathBase::Vector3s Vector3s

Public Functions

inline SolverIpopt(std::shared_ptr<ShootingProblem> problem)

Initialize the Ipopt solver.

Parameters:

problem[in] solver to be diagnostic

~SolverIpopt() = default
inline 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 = Scalar(1e-9)) override

Compute the optimal trajectory \(\mathbf{x}^*_s,\mathbf{u}^*_s\) as lists of \(T+1\) and \(T\) terms.

From an initial guess init_xs, init_us (feasible or not), iterate over computeDirection() and tryStep() until stoppingCriteria() is below threshold. It also describes the globalization strategy used during the numerical optimization.

Parameters:
  • init_xs[in] initial guess for state trajectory with \(T+1\) elements (default [])

  • init_us[in] initial guess for control trajectory with \(T\) elements (default [])

  • maxiter[in] maximum allowed number of iterations (default 100)

  • is_feasible[in] true if the init_xs are obtained from integrating the init_us (rollout) (default false)

  • init_reg[in] initial guess for the regularization value. Very low values are typical used with very good guess points (default 1e-9).

Returns:

A boolean that describes if convergence was reached.

inline virtual void resizeData() override

Resizing the solver data.

If the shooting problem has changed after construction, then this function resizes all the data before starting resolve the problem.

inline void setStringIpoptOption(const std::string &tag, const std::string &value)

Set a string ipopt option.

Parameters:
  • tag[in] name of the parameter

  • value[in] string value for the parameter

inline void setNumericIpoptOption(const std::string &tag, Ipopt::Number value)

Set a string ipopt option.

Parameters:
  • tag[in] name of the parameter

  • value[in] numeric value for the parameter

inline void set_th_stop(const Scalar th_stop)
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)\).

The solver candidates are defined as a state and control trajectories \((\mathbf{x}_s,\mathbf{u}_s)\) of \(T+1\) and \(T\) elements, respectively. Additionally, we need to define the dynamic feasibility of the \((\mathbf{x}_s,\mathbf{u}_s)\) pair. Note that the trajectories are feasible if \(\mathbf{x}_s\) is the resulting trajectory from the system rollout with \(\mathbf{u}_s\) inputs. Updating the candidate invalidates any previously computed linearization; the next call to computeDirection() will therefore refresh the derivatives on demand.

Parameters:
  • xs[in] state trajectory of \(T+1\) elements (default [])

  • us[in] control trajectory of \(T\) elements (default [])

  • isFeasible[in] true if the xs are obtained from integrating the us (rollout)

Public Members

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Ipopt::Number Scalar