Skip to content

Install OpenRAVE#

We use the OpenRAVE core library for simulations. Official links:

Legacy documentation regarding OpenRAVE installations can be found at: (Legacy) Install OpenRAVE

Install OpenRAVE 0.136.1 (Ubuntu 20.04 Focal and newer)#

No official PPA, install from source. Install dependencies that must be installed for compilation:

Note that you will be prompted for your password upon using sudo.

sudo apt install git # probably already installed
sudo apt install libboost-filesystem-dev libboost-system-dev libboost-thread-dev libboost-iostreams-dev
sudo apt install libxml2-dev libode-dev
sudo apt install liblapack-dev
sudo apt install libcollada-dom-dev
sudo apt install libsoqt520-dev libcoin-dev
cd  # go home
mkdir -p repos; cd repos  # create $HOME/repos if it doesn't exist; then, enter it
git clone --branch master https://github.com/rdiankov/openrave.git
cd openrave; mkdir build; cd build
cmake .. -DOPT_VIDEORECORDING=OFF -DOPT_PYTHON=OFF -DOPT_PYTHON3=OFF -DOPT_MSGPACK=OFF -DOPT_ENCRYPTION=OFF
make -j$(nproc)
sudo make install; cd  # install and go home

Install OpenRAVE 0.54.0 (Ubuntu 18.04 Bionic)#

No official PPA, install from source. Install dependencies that must be installed for compilation:

Note that you will be prompted for your password upon using sudo.

sudo apt install git # probably already installed
sudo apt install libboost-filesystem-dev libboost-system-dev libboost-python-dev libboost-thread-dev libboost-iostreams-dev libboost-numpy-dev
sudo apt install libqt4-dev qt4-dev-tools libxml2-dev libode-dev
sudo apt install libsoqt4-dev libcoin80-dev
sudo apt install liblapack-dev
sudo apt install libcollada-dom2.4-dp-dev  # Open .zae files, avoid cmake 3.19 error on 18.04 Bionic
cd  # go home
mkdir -p repos; cd repos  # create $HOME/repos if it doesn't exist; then, enter it
git clone --branch master https://github.com/rdiankov/openrave.git
cd openrave; mkdir build; cd build
cmake .. -DOPT_VIDEORECORDING=OFF -DOPT_PYTHON=OFF
make -j$(nproc)
sudo make install; cd  # install and go home

Install OpenRAVE via scripts (Ubuntu 18.04 Bionic and Ubuntu 20.04 Focal)#

Tested and works on fresh installs. Easy, but not guaranteed to work, nor to be the fastest mechanism (e.g. fcl not mandatory, and osg could alternatively be installed via apt in 20.04 Focal). Provides:

  • Ubuntu 20.04 Focal: OpenRAVE 0.54.0 with Python 2 bindings, FCL, and OpenSceneGraph viewer.
  • Ubuntu 18.04 Bionic: OpenRAVE 0.9.0 with Python 2 bindings, FCL, and Qtcoin viewer.
sudo apt install git lsb-release # probably already installed

On a fresh 20.04 Focal had to configure git email and user, even dummy okay:

git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "MY_NAME@example.com"

Always pay attention to prompts for sudo (and insert password):

cd  # go home
git clone https://github.com/crigroup/openrave-installation
cd openrave-installation
./install-dependencies.sh
./install-osg.sh
./install-fcl.sh
./install-openrave.sh

Troubleshooting OpenRAVE via scripts (Ubuntu 18.04 Bionic and Ubuntu 20.04 Focal)#

Also on 20.04 Focal had to run the pip install ipython h5py numpy scipy wheel line manually, and rm -rf ~/openrave to run ./install-openrave.sh again.

Moreover, if Ubuntu installation not fresh, beware of Python 2 vs 3 issues. Troubleshooting, make sure python --version gives you Python 2, else update-alternatives is your friend. Finally, in line with this, make sure you have the Python 2 development headers, which should be at /usr/include/python2.7.

Extra Tips#

Note that you may end up requiring over 2 GB of free space during the installation of apt dependencies. To avoid that, use the --no-install-recommends option as in:

sudo apt install --no-install-recommends package

Thus, apt would not try to install non-critical packages marked as recommended by the dependencies of OpenRAVE.

Install Additional Plugins: Flexible Collision Library (FCL)#

The following is the Cannonical PPA way, which may not work for you.

sudo apt install libfcl-dev
cd $HOME/repos/openrave; mkdir build; cd build; cmake .. -DOPENRAVE_PLUGIN_FCLRAVE=ON
make -j$(nproc)
sudo make install; cd  # install and go home

The CMakes options when recompiling OpenRAVE are OPT_FCL_COLLISION / OPENRAVE_PLUGIN_FCLRAVE.

Install Additional Plugins: OpenSceneGraph (OSG)#

To get OSG to compile against OpenRAVE, first, you must download a specific version (OpenSceneGraph-3.4.1 for OpenRAVE v0.9.0) and set a CMake flag to use a specific Qt version (-DDESIRED_QT_VERSION=4 for OpenRAVE v0.9.0):

sudo apt-get install libcairo2-dev libjasper-dev libpoppler-glib-dev libsdl2-dev libtiff5-dev libxrandr-dev
git clone --branch OpenSceneGraph-3.4.1 https://github.com/openscenegraph/OpenSceneGraph
cd OpenSceneGraph && mkdir build && cd build
cmake .. -DDESIRED_QT_VERSION=4
make -j4
sudo make install

Then you must fix a set of environmental variables for OpenRAVE to actually detect OSG (else, error such as Required > 3.4, failed because detected 3.4.2):

export LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH"
export OPENTHREADS_INC_DIR="/usr/local/include"
export OPENTHREADS_LIB_DIR="/usr/local/lib64:/usr/local/lib"
export PATH="$OPENTHREADS_LIB_DIR:$PATH"

The CMakes options when recompiling OpenRAVE are OPT_QTOSG_VIEWER / OPENRAVE_PLUGIN_QTOSGRAVE (and the viewer is called "qtosg" in contrast to "qtcoin").

Additional Information#

Offscreen Rendering (OpenRAVE RGB Cameras)#

OpenRAVE requires "Offscreen Rendering" (more specifically called "indirect GLX rendering") to enable virtual RGB cameras in simulated environments. This section summarizes the conclusions from openrave-yarp-plugins#48.

Symptoms that you have no "Offscreen Rendering"#

  1. An offscreen renderer failed (check video driver), disabling message, then constant cannot render offscreen messages.
  2. The OpenRAVE showsensors examples open the main environment window, but no separate window is open displaying the RGB camera output:
  3. Cannot publish RGB camera output via YarpOpenraveGrabber (perma) nor YarpOpenraveRGBDSensor (perma).
  4. You cannot generate .jpg files with the following snippet:

Solution (as of OpenRAVE v0.9.0, all requirements must be met)#

  1. Install working NVIDIA drivers
  2. Create a custom /usr/share/X11/xorg.conf.d/80-custom-glx.conf file (in old Ubuntu distros, this would be part of /etc/X11/xorg.conf) with the following contents:

    Section "ServerFlags"
        Option "AllowIndirectGLX" "on"
        Option "IndirectGLX" "on"
    EndSection
    

  3. Forget about environmental variables COIN_FULL_INDIRECT_RENDERING=1 or COIN_DONT_INFORM_INDIRECT_RENDERING=1 unless you're concerned with warnings: no real effect.

  4. Reboot (resarting the desktop environment should suffice)
  5. For OpenRAVE, use qtcoin as viewer (and not qtosg): openrave --viewer qtcoin (parameter works in several other contexts as well)

If you have no NVIDIA, probably the most interesting read is at openrave-yarp-plugins#48 on DRI and AiGLX, but no results here yet.

Generate Databases#

Source Code Hacks#

Here's a small patch tested on OpenRAVE v0.9.0 to enhance console output on joint limits (provides joint name, and angles in degrees):

cd $HOME/repos/openrave
wget https://github.com/roboticslab-uc3m/openrave-yarp-plugins/files/3896779/98-limit-output.patch.log
git apply 98-limit-output.patch.log # modifies `plugins/basecontrollers/idealcontroller.cpp`
wget https://github.com/roboticslab-uc3m/openrave-yarp-plugins/files/3898656/98-limit-output-2.patch.log
git apply 98-limit-output-2.patch.log # modifies `src/libopenrave/kinbody.cpp`
cd build; cmake ..
make -j$(nproc)
sudo make install; cd  # install and go home

Tutorials and Examples#

Docker#