Skip to content
A fast trajectory optimization library written in Julia
Branch: master
Clone or download
Latest commit 2aeb40e Oct 22, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmark Fix some issues with benchmarks Jul 26, 2019
docs Try building docs again Jul 16, 2019
dynamics quad maze reg fix Jul 25, 2019
examples Add quad timing results Aug 15, 2019
problems Add new quad example Jul 26, 2019
src Add regularization to square root bp Sep 28, 2019
test sqrt cost expansions for sqrt bp, altro solver timer fix Aug 1, 2019
.codecov.yml Update travis to build add gfortran Oct 3, 2018
.gitignore Ignore everything in logs folder Jul 26, 2019
LICENSE Initial commit Jun 20, 2018 TrajectoryOptimization.jl generated files. Jul 14, 2018
Manifest.toml Add TimerOuputs to deps Jul 26, 2019
Project.toml Update to v0.1.1 Oct 22, 2019 one more fix to readme Jul 21, 2019
_config.yml Set theme jekyll-theme-cayman Jan 17, 2019
appveyor.yml TrajectoryOptimization.jl generated files. Jul 14, 2018


Build Status codecov

A library of solvers for trajectory optimization problems written in Julia. Currently, the following methods are implemented with a common interface:

ALTRO (Augmented Lagrangian TRajectory Optimizer): A fast solver for constrained trajectory optimization problems formulated as MDPs that features:

  • General nonlinear cost functions, including minimum time problems
  • General nonlinear state and input constraints
  • Infeasible state initialization
  • Square-root methods for improved numerical conditioning
  • Active-set projection method for solution polishing

Direct Collocation (DIRCOL)

All methods utilize Julia's extensive autodifferentiation capabilities via ForwardDiff.jl so that the user does not need to specify derivatives of dynamics, cost, or constraint functions. Dynamics can be computed directly from a URDF file via RigidBodyDynamics.jl.


To install TrajectoryOptimization.jl, run the following from the Julia REPL:


Quick Start

To run a simple example of a constrained 1D block move:

using TrajectoryOptimization, LinearAlgebra

function dynamics!(ẋ,x,u) # inplace dynamics
    ẋ[1] = x[2]
    ẋ[2] = u[1]

n = 2 # number of states
m = 1 # number of controls
model = Model(dynamics!,n,m) # create model
model_d = rk3(model) # create discrete model w/ rk3 integration

x0 = [0.; 0.] # initial state
xf = [1.; 0.] # goal state

N = 21 # number of knot points
dt = 0.1 # time step

U0 = [0.01*rand(m) for k = 1:N-1]; # initial control trajectory

Q = 1.0*Diagonal(I,n)
Qf = 1.0*Diagonal(I,n)
R = 1.0e-1*Diagonal(I,m)
obj = LQRObjective(Q,R,Qf,xf,N) # objective

bnd = BoundConstraint(n,m,u_max=1.5, u_min=-1.5) # control limits
goal = goal_constraint(xf) # terminal constraint

constraints = Constraints(N) # define constraints at each time step
for k = 1:N-1
    constraints[k] += bnd
constraints[N] += goal

prob = Problem(model_d, obj, constraints=constraints, x0=x0, xf=xf, N=N, dt=dt) # construct problem
initial_controls!(prob,U0) # initialize problem with controls

solver = solve!(prob, ALTROSolverOptions{Float64}())


Notebooks with more detailed examples can be found here, including all the examples from our IROS 2019 paper.


Detailed documentation for getting started with the package can be found here.

You can’t perform that action at this time.