Skip to content

svsawant/leap-c

 
 

Repository files navigation

leap-c (Learning Predictive Control)

Introduction

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.

Installation

Dependencies

leap-c requires the following dependencies that need to be installed separately:

  • casadi for symbolic computations
  • acados for generating OCP solvers

Clone with recursive submodules

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

Installation steps

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

Usage

Check out tests for the point mass system

    python tests/leap_c/test_point_mass.py

Questions/ Contact

Write to [email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Shell 0.2%