Demo
Contents
This repository contains two things
- A general framework for controller testing including robot dynamical system simulation and visualization. There is no state estimation noise, though the simulated dynamics are the true non-linear dynamics with additive gaussian noise
- A fast linear MPC for trajectory tracking on differential drives that is solved via a quadratic program. The controller can enforce kinematically consistent and feasiable outputs such as maximum linear and angular velocity.
References
- The unicycle jacobian, exponential cost increase, and QP formulation are based on the method in this paper.
- This set of notes was generally helpful to me
- This document derrives a simple equation for repeated application of state space propogation in discrete time
I employ a path following MPC which is a variant of the trajectory tracking approach linked in the paper above. It's derivation is inspired from the trajectory tracker, but sufficiently different enough that I've included it below for (mostly self) reference
Derivation
I seek to find the optimal control inputs minimizing the following cost, where
For both the predicted and reference trajectory I use the notation
to refer to the vector of state vectors over the entire horizon, t
By computing all states for the whole horizon, I can denote the predicted trajectory as:
I now substitute this into my original quadratic cost to get a QP over
From here the mapping to the canonical form for CVXOPT is given as