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"#
- An
offscreen renderer failed (check video driver), disabling
message, then constantcannot render offscreen
messages. - The OpenRAVE
showsensors
examples open the main environment window, but no separate window is open displaying the RGB camera output:- OpenRAVE src/cppexamples/orshowsensors.cpp
- OpenRAVE python/examples/showsensors.py (requires Python
openravepy
module)
- Cannot publish RGB camera output via YarpOpenraveGrabber (perma) nor YarpOpenraveRGBDSensor (perma).
- You cannot generate
.jpg
files with the following snippet:- jgvictores snippets/coin3d (perma) (requires
libsimage-dev
)
- jgvictores snippets/coin3d (perma) (requires
Solution (as of OpenRAVE v0.9.0
, all requirements must be met)#
- Install working NVIDIA drivers
-
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
-
Forget about environmental variables
COIN_FULL_INDIRECT_RENDERING=1
orCOIN_DONT_INFORM_INDIRECT_RENDERING=1
unless you're concerned with warnings: no real effect. - Reboot (resarting the desktop environment should suffice)
- For OpenRAVE, use
qtcoin
as viewer (and notqtosg
):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#
- https://github.com/roboticslab-uc3m/teo-openrave-models/tree/master/scripts (permalink)
- https://github.com/roboticslab-uc3m/teo-openrave-models/issues/3
- https://github.com/roboticslab-uc3m/openrave-tools
- https://github.com/roboticslab-uc3m/openrave-yarp-plugins
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#
- http://openrave.org/docs/latest_stable/examples
- http://openrave.org/docs/latest_stable/coreapihtml/cpp_examples.html
- https://scaron.info/teaching/getting-started-with-openrave.html
- https://legacy.gitbook.com/book/crigroup/osrobotics (gitbook)
Similar and Related Projects#
- https://github.com/roboticslab-uc3m?q=openrave (roboticslab-uc3m)
- https://github.com/personalrobotics?q=openrave
- https://github.com/stephane-caron?tab=repositories&q=openrave
- https://github.com/crigroup?q=openrave
- https://github.com/roboticsleeds?q=openrave
- https://github.com/jsk-ros-pkg/openrave_planning
- https://github.com/BerkeleyAutomation/OpenRAVE-motion-planner
- https://github.com/gtrll/orgpmp2
- http://opengrasp.sourceforge.net (https://sourceforge.net/p/opengrasp/code/HEAD/tree/)
- http://www.iearobotics.com/wiki/index.php?title=OpenRave_y_robots_modulares
- http://openrave.programmingvision.com/wiki/index.php/Projects
- https://github.com/MichalXh/debug_ikfast
External Installation Tutorial/Script Links#
- https://scaron.info/teaching/installing-openrave-on-ubuntu-16.04.html
- https://github.com/crigroup/openrave-installation
- Older by same user: [ref1, trusty, see next link if still in trouble with FCL].
- Older by same user: [ref2, xenial].
- [ref3, xenial].
- Not tested: ROS packages such as
ros-indigo-openrave
/ros-kinetic-openrave
. According to this, should be fine but perhaps missing components such asopenravepy
. According to http://docs.ros.org/melodic/api/moveit_tutorials/html/doc/ikfast/ikfast_tutorial.html, may be as easy as:sudo apt install ros-indigo-openrave export PYTHONPATH=$PYTHONPATH:`openrave-config --python-dir`
Docker#
- https://github.com/roboticslab-uc3m/teo-demos-misc/pkgs/container/teo-demos-misc ->
ghcr.io/roboticslab-uc3m/teo-demos-misc:latest
- https://hub.docker.com/r/cielavenir/openrave: jammy tag works (including graphics and python)
- https://hub.docker.com/search?q=openrave&type=image
- https://hub.docker.com/r/hamzamerzic/openrave
- https://hub.docker.com/r/personalrobotics/ros-openrave