robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
Installation

0. Prerequisite

First, please confirm that your OS is Ubuntu 18.04 or 20.04. Next, please confirm that gcc and CMake are installed. If not, they can be installed, e.g., via

sudo apt install build-essential

1. Install Pinocchio

First, install the latest stable version of Eigen3 by

sudo apt install libeigen3-dev

Then install the latest stable version of Pinocchio by following the instruction

2. (Optional, but recommended) Install gepetto-viewer-corba and/or meshcat

If you want to visualize the solution trajectory with Python, you have to install gepetto-viewer-corba by

sudo apt update && sudo apt install robotpkg-py38-qt5-gepetto-viewer-corba -y

and/or meshcat-python by

pip install meshcat

3. Install robotoc

Clone robotoc repository and change the directory as

git clone https://github.com/mayataka/robotoc
Definition: constraint_component_base.hpp:17

Then build robotoc library as

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make install -j$(nproc)

If you want to maximize the performance (recommended), use CMake option

cmake .. -DCMAKE_BUILD_TYPE=Release -DOPTIMIZE_FOR_NATIVE=ON

This option enables the vectorization of Eigen.

If you do not want to install the Python bindings, change the CMake configuration as

cmake .. -DBUILD_PYTHON_INTERFACE=OFF

However, we highly recommend installing Python bindings.

4. (Optional, but recommended) Adding Python path

After installing robotoc and its Python bindings, it is convenient to set the path to robotoc library in Python path. Suppose that the Python version is 3.8. The Python bindings will then be installed at ROBOTOC_INSTALL_DIR/lib/python3.8/site-packages where ROBOTOC_INSTALL_DIR is the install directory of robotoc configured in CMake (e.g., by -DCMAKE_INSTALL_PREFIX or /use/local/lib if you did sudo make install). To use the installed Python library, it is convenient to set the environment variable as

export PYTHONPATH=ROBOTOC_INSTALL_DIR/lib/python3.8/site-packages:$PYTHONPATH

e.g., in ~/.bashrc. Note that if you use another Python version than python3.8, please adapt it.

5. (Optional, but recommended) Install pybullet

To use robotoc_sim module for MPC simulations, please install PyBullet as

pip install pybullet