copra  1.3.3
Copra

License CI Documentation

Copra (**Co**ntrol & **pr**eview **a**lgorithms) is a C++ library implementing linear model predictive control. It relies on quadratic programming (QP) solvers. Python bindings are available.

@Stephane Caron

This work was originally made by Vincent Samy.

Copra is licensed under the BSD-2-Clause. However, its default QP solver (eigen-quadprog) is licensed under the LGPL-2 and this cannot be changed. Please be aware of the related restrictions if you plan to work with copra. At a later date, we might switch copra default QP solver to one with a less restrictive license.

Installation

Copra should compiles and is tested on Linux, macOS and Windows.

Ubuntu LTS (16.04, 18.04, 20.04)

# Make sure you have required tools
sudo apt install apt-transport-https lsb-release ca-certificates gnupg
# Add our key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key 892EA6EE273707C6495A6FB6220D644C64666806
# Add our repository (stable versions)
sudo sh -c 'echo "deb https://dl.bintray.com/gergondet/multi-contact-release $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/multi-contact.list'
# Use this to setup the HEAD version
# sudo sh -c 'echo "deb https://dl.bintray.com/gergondet/multi-contact-head $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/multi-contact.list'
# Update packages list
sudo apt update
# Install packages
sudo apt install libcopra-dev

Dependencies

Optional

Building from source on Linux

The library is written in c++14. Compiler that can not support it won't be able to compile it.

git clone --recursive git@github.com:jrl-umi3218/copra.git
cd Copra
mkdir build && cd build
cmake ..
ccmake . # configure e.g. PYTHON_BINDING or BUILD_TESTING
make -j4
sudo make install

C+11 compatible code

A c++11 compatible is available on a specific branch. Although it exists, it may not be updated as often as the master branch. The branch is called c++11-compatible. To use it, before compilation and after cloning the repo, do:

git checkout c++11-compatible

Then follow the steps in the section just above.

Testing

C++ tests will be compiled in your build folder if you enabled the BUILD_TESTING option:

cd build/tests
./TestSolvers --log_level=all
./TestLMPC --log_level=all

Once Python bindings are installed, you can check them with:

cd binding/python/tests
python TestMPController.py

Documentation

Doxygen documentation is available online

You can also check out unit tests, as well as the following two examples: