leap-c provides tools for learning optimal control policies using learning methodologies Imitation learning (IL) and Reinforcement Learning (RL) to enhance Model Predictive Control (MPC) policies. It is built on top of acados and casadi.
leap-c requires the following dependencies that need to be installed separately:
leap-c uses acados as a submodule. To clone the repository with the submodule, use the following command:
git clone --recurse-submodules [email protected]:leap-c/leap-c.git
Create a python virtual environment using python version 3.11 and activate it:
sudo pip3 install virtualenv
cd <PATH_TO_VENV_DIRECTORY>
virtualenv .venv --python=/usr/bin/python3.11
source .venv/bin/activate
Follow the instructions to build acados here, and also follow the instructions there to install acados' python interface.
Install the required casadi version with the installation script:
cd <PATH_TO_LEAP_C_DIRECTORY>
./install_new_casadi_py311_x86_64.sh
Install the minimum:
pip install -e .
or install with optional dependencies (e.g. for testing):
pip install -e .[test]
Install the desired pytorch version, see here. E.g., to install cpu-only pytorch you can use
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
Check out tests for the point mass system
python tests/leap_c/test_point_mass.py
Write to [email protected]