Problem

Definition

TrajectoryOptimization.ProblemType
struct Problem{Q<:QuadratureRule, T<:AbstractFloat}

Trajectory Optimization Problem. Contains the full definition of a trajectory optimization problem, including:

  • dynamics model (Model)
  • objective (Objective)
  • constraints (ConstraintSet)
  • initial and final states
  • Primal variables (state and control trajectories)
  • Discretization information: knot points (N), time step (dt), and total time (tf)

Constructors:

Problem(model, obj, constraints, x0, xf, Z, N, tf) # defaults to RK3 integration
Problem{Q}(model, obj, constraints, x0, xf, Z, N, tf) where Q<:QuadratureRule
Problem(model, obj, xf, tf; x0, constraints, N, X0, U0, dt, integration)
Problem{Q}(prob::Problem)  # change integration

where Z is a trajectory (Vector of KnotPoints)

Arguments

  • model: Dynamics model. Can be either Discrete or Continuous
  • obj: Objective
  • X0: Initial state trajectory. If omitted it will be initialized with NaNs, to be later overwritten by the solver.
  • U0: Initial control trajectory. If omitted it will be initialized with zeros.
  • x0: Initial state. Defaults to zeros.
  • xf: Final state. Defaults to zeros.
  • dt: Time step
  • tf: Final time. Set to zero to specify a time penalized problem.
  • N: Number of knot points. Defaults to 51, unless specified by dt and tf.
  • integration: One of the defined integration types to discretize the continuous dynamics model.

Both X0 and U0 can be either a Matrix or a Vector{Vector}, but must be the same. At least 2 of dt, tf, and N need to be specified (or just 1 of dt and tf).

source

Methods

TrajectoryOptimization.initial_controls!Method
initial_controls!(::Union{Problem,AbstractSolver}, U0::Vector{<:AbstractVector})
initial_controls!(::Union{Problem,AbstractSolver}, U0::AbstractMatrx)

Copy the control trajectory

source
TrajectoryOptimization.initial_states!Method
initial_states!(::Union{Problem,AbstractSolver}, X0::Vector{<:AbstractVector})
initial_states!(::Union{Problem,AbstractSolver}, X0::AbstractMatrix)

Copy the state trajectory

source
Base.sizeMethod
size(prob::Problem) -> Tuple

Get number of states, controls, and knot points

source