A trajectory optimization library for Matlab
Switch branches/tags
Clone or download
MatthewPeterKelly Merge pull request #35 from MatthewPeterKelly/mpk_fixTypoInUserGuide
Fix small error in the user guide for OptimTraj
Latest commit 662913f May 3, 2018
Permalink
Failed to load latest commit information.
demo Added a new demo: minTimeBvp Jun 5, 2017
docs Fix small error in the user guide for OptimTraj May 3, 2018
.gitignore restructured the docs directory May 15, 2016
LICENSE.md started working on documentation May 4, 2016
README.md Renamed TrajOpt to OptimTraj to avoid confusion with the software fro… May 23, 2016
animate.m cleaned up documentation for examples Jan 3, 2016
chebyshev.m Bug Fix: chebyshev time vector orientation Sep 9, 2016
collectConstraints.m Renamed TrajOpt to OptimTraj to avoid confusion with the software fro… May 23, 2016
directCollocation.m Made sparsity pattern code more clear Sep 16, 2016
getDefaultOptions.m Cleaned up code, removed dircol multiple shooting Jul 10, 2016
gpopsWrapper.m Renamed TrajOpt to OptimTraj to avoid confusion with the software fro… May 23, 2016
hermiteSimpson.m Cleaned up code, removed dircol multiple shooting Jul 10, 2016
inputValidation.m finished adding details about input struct May 4, 2016
multiCheb.m Renamed TrajOpt to OptimTraj to avoid confusion with the software fro… May 23, 2016
optimTraj.m Renamed TrajOpt to OptimTraj to avoid confusion with the software fro… May 23, 2016
optimTraj.png Renamed TrajOpt to OptimTraj to avoid confusion with the software fro… May 23, 2016
optimTraj.svg Renamed TrajOpt to OptimTraj to avoid confusion with the software fro… May 23, 2016
rombergQuadrature.m improved error estimation by using romberg quadrature Mar 2, 2016
rungeKutta.m Cleaned up code, removed dircol multiple shooting Jul 10, 2016
simpsonQuadrature.m Improved quadrature computation in the error estimate for the trapazo… Dec 9, 2015
trapezoid.m Cleaned up code, removed dircol multiple shooting Jul 10, 2016

README.md

OptimTraj - Trajectory Optimization for Matlab

OptimTraj is a matlab library designed for solving continuous-time single-phase trajectory optimization problems. I developed it while working on my PhD at Cornell, studying non-linear controller design for walking robots.

What sort of problems does OptimTraj solve?

Examples:

  • Cart-pole swing-up: Find the force profile to apply to the cart to swing-up the pendulum that freely hanges from it.
  • Compute the gait (joint angles, rates, and torques) for a walking robot that minimizes the energy used while walking.
  • Find a minimum-thrust orbit transfer trajectory for a satellite.

Details:

OptimTraj finds the optimal trajectory for a dynamical system. This trajectory is a sequence of controls (expressed as a function) that moves the dynamical system between two points in state space. The trajectory will minimize some cost function, which is typically an integral along the trajectory. The trajectory will also satisfy a set user-defined constraints.

OptimTraj solves problems with

  • continuous dynamics
  • boundary constraints
  • path constraints
  • integral cost function
  • boundary cost function

All functions in the problem description can be non-linear, but they must be smooth (C2 continuous).

Features:

  • Easy to install - no dependencies outside of Matlab (for base functionality)
  • Lots of examples - look at the demo/ directory to see for yourself!
  • Readable source code - easy to debug your code and figure out how the software works
  • Analytic gradients - most methods support analytic gradients
  • Rapidly switch methods - choose from a variety of methods:
    • direct collocation
      • trapezoid
      • Hermite-Simpson (seperated)
    • direct multiple shooting
      • 4th-order Runge-Kutta
    • global (pseudospectral) collocation
      • Chebyshev (Lobatto) -- (requires chebfun)

Installation:

  1. Clone or download the repository
  2. Add the top level folder to your Matlab path
  3. (Optional) Clone or download chebfun (needed for global collocation)
  4. Done!

Usage:

  • Call the function optimTraj from inside matlab.
  • optimTraj takes a single argument: a struct that describes your trajectory optimization problem.
  • optimTraj returns a struct that describes the solution. It contains a full description of the problem, the transcription method that was used, and the solution (both as a vector of points and a function handle for interpolation).
  • For more details, type help optimTraj at the command line, or check out some of the examples in the demo/ directory.

Contribute:

This code is still under development, and will be from now until at least May 2016. Please contact me if you have any comments or suggestions, or create a pull request if you would like to add content.

If you are interested in contributing, here are a few possible things to do:

  • Create additional demo problems
  • Identify holes in the documentation
  • Report bugs
  • Implement new methods or features

Contributions:

  • Will Wehner wrote the code that enables analytic gradients in the multiple shooting method (4th-order Runge-Kutta).