Installation:OpenRAVE

From OpenRAVE

Jump to: navigation, search

First download the sources from [sourceforge].

Contents

Windows (XP only, later incarnations not supported)

OpenRAVE uses cmake, which can create any variety of visual studio or cygwin files. A lot of the 3rd party libraries like boost 1.39 are already inside the openrave sources.

  • Check out the openrave sources in a path whose directories do not contain spaces (like C:\openrave).
  • Install CMake
  • Install Python 2.6, numpy superpack, and Python Imaging Library (PIL) for openravepy python bindings. (Note that openravepy will not compile in Debug mode unless the python debug libraries are also installed.)
    • IPython is recommended for python development.
    • SciPy, the scientific library for Python, is recommended (necessary for some of the OpenRAVE demos).
  • If you are using Octave, make sure to add the path to mkoctfile to the PATH environment variable. If you are using Matlab, make sure that the path to mex is in the PATH environment variable (ie, typing mex on the command line gives the MATLAB compiler). On Windows Mik-Tex overwrites the mex program with its own version, so any matlab paths have to be declared before Mik-Tex in the PATH variable. You can check if the paths are set correctly by starting up the command prompt and typing mkoctfile or mex.
  • Run runcmake_win.bat, which will auto-detect your compiler system. This will extract msvc_files.tgz, create a build and inside of it you can find openrave.sln. Open the solution file, select the Release or RelWithDebInfo configuration, and build everything. Once done, build the INSTALL project. This should install everything in C:\Program Files\openrave. The installation directory can be changed by manually calling cmake with -DCMAKE_INSTALL_PREFIX="my/new/install/dir".
  • Before running anything, have to modify the following environment variables:
    • To PYTHONPATH - add C:\Program Files\openrave\share\openrave
    • To Path - add C:\Program Files\openrave\bin to the front. Be very careful when putting it in the back since several uses have had problems with different Qt libraries conflicting!

Currently bullet is not setup to compile with OpenRAVE, so don't try to get it working. OpenRAVE will run just fine without it.

Updating Subversion

Whenever updating subversion, it should just be sufficient to run runcmake_win.bat again and then open the solution file build all the projects, and then manually build the INSTALL project. If an update to libraries or programs happens (for example Octave/MATLAB/python was installed/uninstalled), it is recommended to clear the cmake cache by first removing build/CMakeCache.txt before running runcmake_win.bat.

Linux/Mac OSX

OpenRAVE works only with qt4! Before compiling SoQt or OpenRAVE make sure to remove any qt3 related dev packages like (qt3-dev-tools,libqt3-headers).

If there are compilation errors with templates, might have to use gcc version 4.1 or greater. You can check your version of gcc (or g++) by gcc --version.

Ubuntu Users Package Pack (optional)

For Ubuntu 8.04 or earlier:

sudo apt-get install g++ cmake libqt4-dev qt4-dev-tools ffmpeg libavcodec-dev libavformat-dev libxvidcore-dev libx264-dev libfaac-dev libogg-dev libvorbis-dev libdc1394-dev liblame-dev libgsm1-dev libboost-dev libboost-regex-dev libxml2-dev libglew-dev libboost-graph-dev libboost-wave-dev libboost-serialization-dev libboost-filesystem-dev libpcre3-dev libboost-thread-dev

For Ubuntu 8.10 users:

sudo apt-get install g++ cmake libqt4-dev qt4-dev-tools ffmpeg libavcodec-dev libavformat-dev libxvidcore4-dev libx264-dev libfaac-dev libogg-dev libvorbis-dev libdc1394-22-dev libgsm1-dev libboost-dev libboost-regex-dev libxml2-dev libglew1.5-dev libsoqt4-dev libboost-graph-dev libode0-dev libboost-wave-dev libboost-serialization-dev libboost-filesystem-dev libpcre3-dev libboost-thread-dev

For Ubuntu 9.04 users:

sudo apt-get install g++ cmake libqt4-dev qt4-dev-tools ffmpeg libavcodec-dev libavformat-dev libxvidcore4-dev libx264-dev libfaac-dev libogg-dev libvorbis-dev libdc1394-22-dev libgsm1-dev libboost-dev libboost-regex-dev libxml2-dev libglew1.5-dev libsoqt4-dev libboost-graph-dev libode0-dev libboost-wave-dev libboost-serialization-dev libboost-filesystem-dev libpcre3-dev libboost-thread-dev libswscale-dev

Video recording notes: The avcodec library in Ubuntu 8.10 has removed all mpeg encoders due to legal issues, this means that OpenRAVE recording will always fail with a codec not found message. To get it working, please install the libavformat-unstripped-52 and libavcodec-unstripped-51 packages. Unfortunately, these packages cannot coexist with the dev packages, so you should first compile openrave with the normal libavcodec-dev and libavformat-dev packages, and then switch to the unstripped versions when recording.

Fedora Core Users

You might need to add the livna yum repository for ffmpeg. To install the necessary packages type

sudo yum install qt4-devel Coin2-devel glew-devel gsm-devel x264 x264-devel ffmpeg-devel libdc1394-devel libtheora-devel libmp4v2-devel ode-devel boost-devel cmake

Be careful if installing soqt-devel from the package manager, it may be compiled with the wrong version of Qt.

If compiling SoQt, check QTDIR and make sure it points to the correct version.

Max OS X

  • First install these libraries:
sudo port install cmake boost libxml2 glew octave
  • Qt - download the installer. Can also use port install qt4-mac, but this will take an hour or two.
  • Coin3D - download the installer
  • SoQt - downoad the latest source from here. Might ask you to set QTDIR to the correct directory.
  • ffmpeg and other video recording codecs

Necessary libraries for Old Linux Distros (Only install from sources if not in package manager)

  • boost - get from package manager.
  • Coin3d - usually package managers have it, but in case they don't: download and install from http://www.coin3d.org.
  • SoQt - If installing from package manager, make sure that it is compiled with qt4! Otherwise, download the latest snapshot from here (do not download the official SoQt 1.4.1 code)
    • For x86-64 users: SoQt might give a compilation error in SoQtComponent.cpp. To fix it, go into src/Inventor/Qt/SoQtComponent.cpp and on line 103 replace 'unsigned long key' with 'SbDict::Key key'.

Collision Checkers/Physics Simulators

Although OpenRAVE is not tied to any particular collision checker, it requires you install at least one to get things working.

  • ODE Collision/Physics - install from sources 0.8-0.10.1 tested to work. It is possible to compile ODE with double precision.
    • For 0.10.1, configuring with--enable-new-trimesh option will randomly crash openrave, so use at your own risk.
    • If not using enable-new-trimesh, disabling asserts (via --disable-asserts) is necessary due to some weird bug in normalization.
    • For 0.10+. If you are installing on x86-64 distro, you have to configure ODE with --enable-shared.
    • To compile OpenRAVE with double precision, ODE must be compiled with double precision (via --enable-double-precision)
  • Bullet Collision (use v2.74 or greater) - Need to install to a system directory so OpenRAVE can find it using pkg-config. If using autotools' configure, need to remove install-sh before running autogen.sh. The command lines become:
rm install-sh
./autogen.sh
./configure
make
make install

OpenRAVE will detect bullet when pkg-config --libs bullet outputs the installed libraries.

Building OpenRAVE

To install openrave and all plugins, in the root openrave folder type

make

This will compile all files. To install the files type

make install

Currently the default install directory is ${OPENRAVE_SOURCE_DIR}/localinstall. To choose a different install directory, type

make prefix=/usr/local

Consult the INSTALL file in the openrave root directory for more information on various options.

In case libraries are added after the initial install of OpenRAVE, the build/CMakeCache.txt file should be removed before recompiling OpenRAVE. Otherwise, the new system changes will not be noticed.

Python

In order to use the python bindings through the openravepy module, install python numpy, boost python, and python-dev before compiling openrave (If these packages are installed openrave has been compiled, first remove build/CMakeCache.txt). To setup the python path in bash add the following line:

export PYTHONPATH=$PYTHONPATH:`openrave-config --python-dir`

Some demos also require the python scipy and python imaging tk libraries. The Ubuntu Linux command line for all python packages would be:

sudo apt-get install libboost-python-dev python python-numpy python-scipy python-imaging-tk

Octave/Matlab

Both Octave and Matlab are supported and the OpenRAVE build system automatically detects and compiles the mex files for each (call 'make' OpenRAVE after the scripting environments have been installed).

  • For Octave users. Make sure mkoctfile is in your path. For Linux users installing octave from the package managers, you have to also install the octave headers package. All the octave functions are stored in ${OPENRAVE_INSTALL_DIR}/share/openrave/octave.
  • For matlab users, make sure mex is in your path and is the MATLAB mex function. All the matlab functions are stored in ${OPENRAVE_INSTALL_DIR}/share/openrave/matlab.

For linux, the default install dir is /usr/local. For windows, the default OPENRAVE_INSTALL_DIR is c:\Program Files\openrave. In order to use these functions, call addpath on the appropriate directory inside the Octave/Matlab commands windows. Then savepath to save the settings.

For Windows users using Octave:

  • If you are having problems with the JVM, try installing octave using gnuplot (rather than jhandles).
  • Compiling mex files should use the same compiler as was used to build the Octave package. As of October 2008, the official Octave binaries are compiled with Visual Studio 2005 (freely available).

For users using Matlab:

  • Make sure that mex actually points to the Matlab mex function

Miscellaneous CMake Options

There are many cmake options that control how OpenRAVE is built. Once OpenRAVE is built, most of them can be set by executing

ccmake build

in the root folder. For example, to disable ffmpeg video recording, find the ENABLE_VIDEORECORDING option and turn it to OFF.

You can also set these options during the cmake build time by executing cmake yourself (if you notice all the Makefiles do is wrap calls to cmake), and adding command line arguments like '-DENABLE_VIDEORECORDING=OFF'

Double precision

To compile OpenRAVE with double precision support (ie all dReal types become doubles), set DOUBLE_PRECISION to ON during cmake. For example:

cmake -DDOUBLE_PRECISION=ON ...

Global Plugins and Data Directories

OpenRAVE can be configured to look for plugins and data files like robots and geometry models by two environment variables:

  • OPENRAVE_PLUGINS - Use ':' to separate each directory (';' for Windows). At startup, OpenRAVE searches for every shared object/dll plugin in these directories and loads them. If not set, gets defaulted to ${OPENRAVE_INSTALL_DIR}/share/openrave/plugins
  • OPENRAVE_DATA - Use ':' to separate each directory (';' for Windows). Everytime OpenRAVE loads a file, it will search it in these directories. If not set, gets defaulted to ${OPENRAVE_INSTALL_DIR}/share/openrave
  • OPENRAVE_HOME - Used to set the directory where all openrave specific cached data is stored (like inverse kinematics solvers, robot pre-processed data, etc). The default is ~/.openrave.
  • OPENRAVE_IKFAST - Used to load a set of inverse kinematics solvers generated by ikfast. The variable specifies the IK solver name and the shared object/DLL to load. Format is: iksolver1=/path/to/iksolver.so:iksolver2=/second/path/to/solver.so. With ':' separation for Linux and ';' separation for Windows.

OpenRAVE Home Directory

The cache/home directory specified in OPENRAVE_HOME holds various options/settings for OpenRAVE along with cached robot information.

Example settings files:

Personal tools