Model Types
This page provides details on specific sub-types of AbstractModel that are curently implemented in TrajectoryOptimization.jl.
Abstract Model
TrajectoryOptimization.AbstractModel — Typeabstract type AbstractModelAbstraction of a model of a dynamical system of the form ẋ = f(x,u), where x is the n-dimensional state vector and u is the m-dimensional control vector.
Any inherited type must define the following interface: ẋ = dynamics(model, x, u) n,m = size(model)
Rigid Body Models
TrajectoryOptimization.RigidBody — Typeabstract type RigidBody <: AbstractModelAbstraction of a dynamical system with free-body dynamics, with a 12 or 13-dimensional state vector: [p; q; v; ω] where p is the 3D position, q is the 3 or 4-dimension attitude representation, v is the 3D linear velocity, and ω is the 3D angular velocity.
Interface
Any single-body system can leverage the RigidBody type by inheriting from it and defining the following interface:
forces(::MyRigidBody, x, u) # return the forces in the world frame
moments(::MyRigidBody, x, u) # return the moments in the body frame
inertia(::MyRigidBody, x, u) # return the 3x3 inertia matrix
inertia_inv(::MyRigidBody, x, u) # return the 3x3 inverse of the inertia matrix
mass_matrix(::MyRigidBody, x, u) # return the 3x3 mass matrixRotation Parameterization
A RigidBody model must specify the rotational representation being used. Any of the following can be used:
UnitQuaternion: Unit Quaternion. Note that this representation needs to be further parameterized.MRP: Modified Rodrigues ParametersRPY: Roll-Pitch-Yaw Euler angles
Infeasible Models
TrajectoryOptimization.InfeasibleModel — Typestruct InfeasibleModel{N, M, D<:AbstractModel} <: AbstractModelAn infeasible model is an augmented dynamics model that makes the system artifically fully actuated by augmenting the control vector with n additional controls. The dynamics are handled explicitly in discrete time:
$x_{k+1} = f(x_k,u_k,dt) + w_k$
where $w_k$ are the additional n-dimensional controls. In practice, these are constrained to be zero by the end of the solve.
Constructors
InfeasibleModel(model::AbstractModel)