wiki:RCLLSimulationSetupDistributed
Last modified 3 years ago Last modified on 02/08/17 16:08:13

Distributing the Gazebo simulation over multiple machines

You can run the simulation distributed to let one machine host the simulation and distribute the robot software across multiple machines.
In the examples shown below, the simulation and the first robot runs on stargazer, the second robot runs on voyager, and the third one on pegasus. Exchange the host names according to your setup.

Ports

Make sure that the your machines can access each others ports (In the RoboLab? they should already be configured). You need the following ones:

Fawkes (TCP): 1910, 1921-1926
Webview (TCP): 8088, 8081-8086
Gazbeo (TCP): 11345
ROS (TCP): 11311, 11321-11326
MongoDB (TCP): 27011-27017, 27021-27026, 27031-27036, 27041-27046
RCLL-Refbox/Sim-Bot-Kommunikation (UDP): 4411-4486

Config Changes

First you have to adjust the config in cfg/conf.d/gazsim.yaml for a working refbox/protobuf communication:

  comm:
    addresses:  ["stargazer", "stargazer", "voyager", "pegasus", "127.0.0.1", "127.0.0.1", "127.0.0.1"]

Simulation

Then you can start the simulation:

./gazsim.bash -n 0

Robot Startup

Each system hosting a robot needs to start a roscore, a communication proxy, and fawkes (exchange robotino2.yaml with the corresponding robot number):

ssh voyager
screen

In screen 1:

export ROS_MASTER_URI=http://localhost:11321/
roscore --port 11321

In screen 2:

cd fawkes-robotino/bin
./fawkes -p gazsim-comm

In screen 3:

export GAZEBO_MASTER_URI=http://stargazer:11345
export ROS_MASTER_URI=http://localhost:11321/
cd fawkes-robotino/bin
./fawkes -c gazsim-configurations/default/robotino2.yaml -p gazsim-meta-robotino-ros,gazsim-meta-robotino-vision-high-level,gazsim-meta-agent

Now the robot should appear in the refbox after setting the team and it's localization marker should spawn in the simulation. Probably you have to localize the robot (e.g. via rviz or with a './gazsim-publish-initial-pose.bash -d' on it's machine)