-
Notifications
You must be signed in to change notification settings - Fork 32
TOL Revolve install instructions
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 build && cd build cmake .. -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_INSTALL_PREFIX=/usr make -j4 sudo make install
First, if not alredy 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/
After that, run the following commands:
brew install boost bullet doxygen ffmpeg freeimage gdal gts libtar protobuf protobuf-c python qt tbb tinyxml pip install virtualenv brew tap osrf/simulation brew install ignition-math2 ogre player sdformat3 simbody #note by Matteo: I really doubt that this is the "dart" you need. This is the dart programming language from google. -brew tap dart-lang/dart- -brew install dart --with-content-shell --with-dartium- brew update brew upgrade
Before cloning repositories, make new empty directory, eg. @~/projects/revolve-simulator@ and clone repos there:
mkdir -p ~/projects/revolve-simulator cd ~/projects/revolve-simulator hg clone https://bitbucket.org/ElteHupkes/gazebo git clone https://github.com/ElteHupkes/revolve.git git clone https://github.com/ElteHupkes/tol-revolve.git
Cloning Gazebo repository may take a while. Next step is to checkout to @gazebo6-revolve@ branch.
cd gazebo hg up gazebo6-revolve mkdir 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 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
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:
mkdir build && cd build cmake -DCMAKE_BUILD_TYPE="Release" -DLOCAL_BUILD_DIR=1 ../cpp 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:
mkdir build && cd build cmake -DCMAKE_BUILD_TYPE="Release" -DREVOLVE_BUILD_PATH="`pwd`/../../revolve/build" ../cpp 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 plugin 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 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.
Alright, with all that installed you should be able to run the basic demos. The tol-revolve/tools
directory is a mess but contains some useful scripts. Running ./nemodemo
from there should launch the interactive evolution demo for instance. Note that this will in fact launch three separate things:
- Gazebo (server + client)
- The body analyzer (a separate instance of gzserver to analyze body intersections)
- The Python managing code
Anyhow, that's just to verify things work, you can play around with it of course. Let's get to the main issue, performance, the slowing down with repeated insertion / deleting in particular. I got rid of some memory leaks earlier but this does not seem to have solved it. I've written a script showing the current problem. To run it, use two terminals, in the first:
cd tol-revolve/tools ./runbenchmark
In the second:
cd tol-revolve # If not activated already . .venv/bin/activate python scripts/slowdown.py
This script will do nothing more than insert a robot consisting of one simple block into the world, wait for approximately 5 seconds simulation time, remove the block and repeat. For each sequence it records the wallclock time required for these 5 simulation seconds. It prints four values: the time taken, the average time over the last max 10, the "real time factor" (rtf) (i.e. sim time / time) and the average real time factor. A typical run starts at an rtf of about 50 for me but rapidly decreases as more robots are deleted / added. But there must be something that isn't cleaned up properly. I wish I could be of more help here but I haven't had the time to investigate this properly myself.
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 |
|| ||