Simulation | Real Robot |
---|---|
DWMPC is a library for distributed model predictive control (MPC) of quadruped robots. This repository includes the core MPC controller in cpp and example usage with the gym-quadruped
environment in Python. The provided acados solver has been generated for aliengo. If you want to try with different robots check this Python file to generate a new C solver.
Before proceeding with the installation, ensure that the following dependencies are available on your system:
- CMake
- GCC
- Python 3 (along with development headers)
- Eigen3
- YAML-CPP
- Pybind11
- ndcurves
- acados
To get started, clone the repository and initialize all submodules:
git clone https://github.com/iit-DLSLab/DWMPC.git
cd DWMPC
git submodule update --init --recursive
sudo apt-get install -y cmake g++ python3 python3-dev python3-pip libeigen3-dev libyaml-cpp-dev pybind11-dev
Follow the instructions to install the ndcurves
library from the official repository
Navigate to the acados
directory and build the library:
cd third_party/acados
mkdir build && cd build
cmake ..
make install -j4
After building, add acados
to your LD_LIBRARY_PATH
:
export LD_LIBRARY_PATH=<path_to_acados\lib>:$LD_LIBRARY_PATH
From the main DWMPC
repository, create a build directory and compile the project:
cd ../../
mkdir build && cd build
cmake ..
make -j8 && sudo make install
Add the DWMPC
library to your environment:
export LD_LIBRARY_PATH=/usr/lib/dls2/controllers/dwmpc:$LD_LIBRARY_PATH
export PYTHONPATH=$PYTHONPATH:/usr/lib/dls2/controllers/dwmpc
For running the example scripts, install the gym-quadruped
environment from the the official repository
@INPROCEEDINGS{amatucciIROS2024,
title={Accelerating Model Predictive Control for Legged Robots through Distributed Optimization},
author={Lorenzo Amatucci and Giulio Turrisi and Angelo Bratta and Victor Barasuol and Claudio Semini},
booktitle={2024 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
year={2024}
}