This repo containes the multirate-mpc-cbf package, which is a layered multi-frequency control architecrure introduced in [1].
The OSQP library is required.
This library can be installed using the following commands:
mkdir build && cd build
cmake ..
make install
To check if the library is installed correctly you can test the MPC
reset
g++ src/mpc_test.cpp -o mpc_test.o -I /usr/local/include/osqp/ -L /usr/local/lib/osqp/ -losqp -L /usr/local/lib/mpc/ -lmpc
./mpc_test.o
and the CBF
reset
g++ src/cbf_test.cpp -o cbf_test.o -I /usr/local/include/osqp/ -L /usr/local/lib/osqp/ -losqp -L /usr/local/lib/mpc/ -lmpc
./cbf_test.o
Checkout our Segway ROS simulator to see how to use this library.
This code is based on the following article:
- U. Rosolia and A. D. Ames, "Multi-Rate Control Design Leveraging Control Barrier Functions and Model Predictive Control Policies," in IEEE Control Systems Letters, vol. 5, no. 3, pp. 1007-1012, July 2021, PDF