Skip to content

Linear MPC (Model Predictive Control) Path Following

Notifications You must be signed in to change notification settings

qhdwight/mpc-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

When I wrote this I was a convex optimization NOOB! I know more know and want to revamp when I find time...

Linear Model Predictive Control

Demo

2022-09-20.13-51-06.mp4

Idea

We can model our system and predict its state into the future. We can also model how our inputs affect this future state. Using a constraint solver such as QP, we can find a series of control inputs that minimizes error over a "horizon" or short time in the future.

See: https://web.stanford.edu/class/archive/ee/ee392m/ee392m.1056/Lecture14_MPC.pdf

Libraries

nalgebra for matrix operations

splines for linear interpolation

osqp for a sparse QP solver

Bevy for visualization + lyon for path rendering

Code

controller.rs Linear MPC implementation, QP solver over horizon

robot.rs Kinematic modeling of unicycle robot

math.rs Misc. features for nalgebra since it is relatively new

Acknowledgments

This repository was inspired by https://github.com/niwhsa9/mpc-trajectory-tracker

About

Linear MPC (Model Predictive Control) Path Following

Topics

Resources

Stars

Watchers

Forks

Languages