wiki:AllemaniACs/SimulationSetup
Last modified 4 years ago Last modified on 01/28/16 15:43:21

Gazebo Simulation Setup for fawkes-athome

Install Gazebo

Ubuntu

sudo apt-get install gazebo

Fedora

sudo yum install gazebo-devel tinyxml-devel

Compile from Source

Fedora needs the following packages:
PyOpenGL boost-devel cegui-devel cmake console-bridge-devel doxygen freeimage-devel gperftools-devel gtest-devel gts-devel libccd-devel libtool-ltdl-devel libXext-devel libxml2-devel ogre-devel protobuf-devel qt-devel tbb-devel tinyxml-devel urdfdom-headers-devel urdfdom-devel texlive-multirow texlive-sectsty texlive-tocloft texlive-xtab libtar-devel

Follow the instructions from here

Setup Robotino Simulation

Fawkes

Required branches in fawkes-athome:
(last checked: 2015-12-01)

  • origin/master

Required branches in fawkes:
(last checked: 2015-12-01)

  • origin/master

NOTE: If you have problems with compiling/linking check pkg-config --libs/--cflags 'gazebo' for single -l/-I and remove them.

Gazebo Models and Plugins

For the models and plugins in Gazebo you need two repositories. One with all base plugins and models and one with athome-specific stuff: You can find the first one here here: https://github.com/robocup-logistics

cd
git clone https://github.com/robocup-logistics/gazebo-rcll.git
cd gazebo-rcll/plugins
make -j8

and the athome-specific one here:

cd
git clone git@git.fawkesrobotics.org:gazebo-athome.git

Environmental Variables

Setup the environmental variables in your .bashrc (or similar for other install locations):

# assuming you cloned all the repositories into your home directory:
export FAWKES_ATHOME_DIR=~/fawkes-athome
export GAZEBO_RCLL_DIR=~/gazebo-rcll
export GAZEBO_ATHOME_DIR=~/gazebo-athome
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:$GAZEBO_RCLL_DIR/plugins/lib/gazebo
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$GAZEBO_RCLL_DIR/models:$GAZEBO_RCLL/models/carologistics:$GAZEBO_ATHOME_DIR/models

export GAZEBO_ATHOME_WORLD_PATH=$GAZEBO_ATHOME_DIR/worlds/robolab.world

Configuration

It is possible to define multiple overall-strategy configurations for different simulation runs. These are represented by the folders in cfg/gazsim-configurations. Every overall-strategy has seperated configurations for each of the three Robotinos. Every configuration consists of the robotinoX.yaml, which replaces the default config.yaml, and the host_robotino_X.yaml, which acts as an host.yaml and overrides config values defined in cfg/conf.d/. If you want to create a new overall-strategy, you have to link the host_robotino.yaml in the sim-robotino.yaml.

Start the Simulation

Script

There is a script that starts everything to setup the simulation automatically:

cd ~/fawkes-athome/bin
./gazsim.bash -s

Manually

Start Gazebo

gazebo $GAZEBO_ATHOME_WORLD_PATH

Start a Roscore

roscore

Start Fawkes with the default configuration in fawkes-robotino/bin

./fawkes -c gazsim-configurations/sim-robotino.yaml -p m_gazsim_robotino

At the moment you also need to do some local changes: Comment out all configuration lines in cfg/conf.d/laser_filder.yaml and all katana skills in src/lua/skills/athome/init.lua

Replay

If you recorded a game you can replay it with

gazebo -p path-to-replay/state.log

If the file is corrupt you may have to add '</gazebo_log>' at the end.