https://github.com/qhdwight/mpc-rs
Linear MPC (Model Predictive Control) Path Following
https://github.com/qhdwight/mpc-rs
control-systems mpc robotics rust rust-robotics
Last synced: 4 months ago
JSON representation
Linear MPC (Model Predictive Control) Path Following
- Host: GitHub
- URL: https://github.com/qhdwight/mpc-rs
- Owner: qhdwight
- Created: 2022-08-21T02:39:50.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-07T06:44:34.000Z (6 months ago)
- Last Synced: 2025-02-28T03:26:51.240Z (4 months ago)
- Topics: control-systems, mpc, robotics, rust, rust-robotics
- Language: Rust
- Homepage:
- Size: 53.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> [!WARNING]
> When I wrote this I was a convex optimization NOOB! I would like to rewrite this when I can find the time...# Linear Model Predictive Control
### Demo
https://user-images.githubusercontent.com/20666629/191329146-cf487d34-716d-4843-b2ec-523a79885047.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](https://nalgebra.org/) for matrix operations
[splines](https://docs.rs/splines/latest/splines/) for linear interpolation
[osqp](https://docs.rs/osqp/latest/osqp/) for a sparse QP solver
[Bevy](https://bevyengine.org/) for visualization + [lyon](https://github.com/Nilirad/bevy_prototype_lyon) for path rendering
### Code
[controller.rs](./src/controller.rs) Linear MPC implementation, QP solver over horizon
[robot.rs](./src/robot.rs) Kinematic modeling of unicycle robot
[math.rs](./src/math.rs) Misc. features for [nalgebra](https://nalgebra.org/) since it is relatively new
### Acknowledgments
This repository was inspired by https://github.com/niwhsa9/mpc-trajectory-tracker