Skip to content

Conversation

@i3ta
Copy link
Collaborator

@i3ta i3ta commented Jul 10, 2025

Summary

Implemented LQMPC in C++ using OSQP.

This PR adds an LQMPC implementation similar to the other LQR controllers. Functioning examples for Gaussian observations were also added for both controlling the state and the output. Partially functional implementations of LQMPC for Poisson observations are included, but the example (eg_plds_mpc) does not work fully and still needs to be debugged.

Changes

  • Added and installed OSQP
  • Added examples
    • eg_glds_mpc: Same example as eg_glds_ctrl but controlled with LQMPC with a perfect system and no disturbance, controlling the output
    • eg_lqmpc_ctrl: Same example as from the Python lqmpc repository, controlling the input
    • eg_plds_mpc: Same example as eg_plds_ctrl but controlled with LQMPC; only partially functional. Also modified parts of eg_plds_ctrl to produce the same trajectory and disturbance so the results of the two controllers can be compared
  • Added matlab files to plot example outputs

i3ta and others added 29 commits May 12, 2024 13:12
The commit that the vcpkg submodule was linked to depended on a version of zlib that was downloaded from the zlib website that is outdated. This commit updates the vcpkg to the newest version, which gets zlib directly from the github repository.
Roughly implemented the example code for MPC controller, based on the example from cloctools/lqmpc.
- The code for the MpcController is partially implemented (only necessary methods have been added, getters and setters need to be added)
- Code still needs to be debugged (there are multiple memory leaks that need to be fixed)
Defined and renamed arma::SpMat<data_t> to the Sparse shorthand
…apper for OSQP that interfaces with Armadillo matrices
Update OSQP Installation Process
Added MPC control for Poisson system, and added example to show it in
action
Combining clones of kyle-mpc and aaron-implement-mpc
Fixed the eg_glds_mpc example to remove unused code sections (imperfect
model, disturbance) and modified output to include cost over time. Added
output plotting matlab file.
@i3ta i3ta requested a review from kjohnsen July 10, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants