-
Notifications
You must be signed in to change notification settings - Fork 1
Installing the simulation suite
Here we provide instructions for Ubuntu Linux, and Mac OS operating systems. If you run into any difficulties, please feel free to contact us.
Build instructions for Ubuntu 16.04
This part of manual is for Ubuntu 14.04.2 (Trusty) or newer, but probably will work without problems on other Debian based distributions. First, make sure that the Ubuntu pre-compiled binaries are removed.
sudo apt-get purge '.*gazebo.*' '.*sdformat.*' '.*ignition-math.*'
Install prerequisites. A clean system will need:
wget https://bitbucket.org/osrf/release-tools/raw/default/jenkins-scripts/lib/dependencies_archive.sh -O /tmp/dependencies.sh ROS_DISTRO=dummy . /tmp/dependencies.sh sudo apt-get install $(sed 's:\\ ::g' <<< $GAZEBO_BASE_DEPENDENCIES) $(sed 's:\\ ::g' <<< $BASE_DEPENDENCIES) sudo apt-get install python pip install virtualenv
If DART http://dartsim.github.io/ is planed to be used, you can install it with: (not to be confused with http://dartlang.org)
# Only needed on Trusty. Ubuntu packages since sudo apt-add-repository ppa:libccd-debs sudo apt-add-repository ppa:fcl-debs # Main repository sudo apt-add-repository ppa:dartsim sudo apt-get update sudo apt-get install libdart-core5-dev
For other optional dependencies:
sudo apt-get install ruby-ronn sudo apt-get install robot-player-dev*
SDFormat and Gazebo depend on the ignition math library.
hg clone https://bitbucket.org/ignitionrobotics/ign-math /tmp/ign-math cd /tmp/ign-math mkdir build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr make -j4 sudo make install
Gazebo depends on the SDFormat package.
cd /tmp wget http://osrf-distributions.s3.amazonaws.com/sdformat/releases/sdformat-3.1.1.tar.bz2 tar -xaf /tmp/sdformat-3.1.1.tar.bz2 cd /tmp/sdformat-3.1.1 mkdir -p build && cd build cmake .. -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_INSTALL_PREFIX=/usr make -j4 sudo make install
First, if not already available, install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" xcode-select --install
Install XQuartz, which provides X11 support and is required by Gazebo and OGRE. XQuartz is available on http://www.xquartz.org/
NOTE: If you want the Dart engine enabled, follow these commands: (These steps needs to be verified)
# Add dartsim/dart tap so formulae of dart and the dependencies will be found brew tap dartsim/dart # Also add homebrew/science tap for libccd formula and flann formula brew tap homebrew/science # Install brew (core only) brew install dartsim5 --core-only
After that, run the following commands:
brew install boost \ bullet \ cmake \ doxygen \ ffmpeg \ freeimage \ gdal \ git \ gsl \ gts \ hg \ libtar \ protobuf protobuf-c \ python \ tbb \ tinyxml \ yaml-cpp pip install virtualenv brew tap cartr/qt4 brew tap-pin cartr/qt4 brew install cartr/qt4/qt --without-webkit brew tap osrf/simulation brew install ignition-math2 \ ogre \ sdformat3 \ simbody # brew install player brew update brew upgrade
NOTE: If this type of error occurred during build-time:
ld: library not found for -lintl clang: error: linker command failed with exit code 1 (use -v to see invocation)
gettext is not linked in /usr/include, so the following command will solve the problem:
brew link --force gettext
Before cloning repositories, make new empty directory, eg. @~/projects/revolve-simulator@ and clone repos there:
mkdir -p ~/projects/revolve-simulator cd ~/projects/revolve-simulator export SIM_HOME=`pwd` git clone https://github.com/ci-group/gazebo.git -b gazebo6-revolve git clone https://github.com/ci-group/revolve.git git clone https://github.com/ci-group/tol-revolve.git git clone https://github.com/ci-group/revolve-brain.git
Cloning Gazebo repository may take a while. Next step is to checkout to @gazebo6-revolve@ branch.
cd $SIM_HOME/gazebo mkdir -p build && cd build cmake .. -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DENABLE_SSE4=True \ -DENABLE_TESTS_COMPILATION:BOOL=False make -j4 make install
NOTE: After installation, if gazebo
could not be found, -DCMAKE_INSTALL_PREFIX=/usr
should be added to cmake
command and then make -j4 install
again. When this is done gazebo
command should be able to run in a terminal and get the default world.
NOTE: If you get an error compiling the video section of gazebo, apply this patch
https://bitbucket.org/osrf/gazebo/commits/df5f96a6695f8dbe8d05bb885aed2913a09170b9
Next up is compiling Revolve. Go into the @revolve@ directory and do:
cd $SIM_HOME/revolve mkdir -p build && cd build cmake ../cpp \ -DCMAKE_BUILD_TYPE="Release" \ -DLOCAL_BUILD_DIR=1 make -j4
NOTE: The LOCAL_BUILD_DIR=1
enables a dirty hack that makes the build directory look like an include path until I get the installation sorted out. Assuming Gazebo and all dependencies are correctly installed this should compile Revolve without issue. If it can't find gazebo try installing Gazebo again with the install prefix as mentioned above.
The next step is compiling TOL-Revolve. Go into that directory, and:
cd $SIM_HOME/tol-revolve mkdir -p build && cd build cmake ../cpp \ -DCMAKE_BUILD_TYPE="Release" \ -DREVOLVE_BUILD_PATH="`pwd`/../../revolve/build" make -j4
Set the path to your value of course. This should compile the ToL resources. To test whether all is working as expected, go into the tol/tools
directory and run ./runbenchmark
. Although this loads an empty world, it should display "World plugin loaded" if the ToL plug-in is successfully compiled and loaded.
The final steps is to get the Python dependencies for tol-revolve ready so we can run that. For this you need virtualenv; I've no idea how to install that on Mac but it shouldn't be difficult (brew install virtualenv or something might work). Then:
cd $SIM_HOME/tol-revolve virtualenv .venv . .venv/bin/activate pip install -r requirements.txt
Oh, if virtualenv installs a different version than Python 2.x by default you'll have to change that. It's 2.7.6 for me atm.
For more information about the Triangle of Life concept visit http://evosphere.eu/.
_________________
/ Premature \
| optimization |
| is the root of |
| all evil. |
| |
\ -- D.E. Knuth /
-----------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||