Wiki

Clone wiki

subt / tutorials / cloudsim

Back to Getting Started

Mirror Cloudsim Locally

The instructions below explain how to setup two of the three docker images to mirror locally the Cloudsim environment.

  1. cloudsim_sim: This will be used by CloudSim to run simulation.
  2. cloudsim_bridge: This will be use by CloudSim to run a ROS master and the ROS1-Ign bridge..

Before your start:

  1. Install docker (version >= 19.03 recommended)
  2. Setup the catkin workspace for the SubT Simulation testbed

Terminal 1: Build and run the cloudsim_sim docker image

This is the docker image that corresponds to the "Simulation Container" on the Cloudsim architecture:

cd ~/subt_ws/src/subt/docker/

chmod +x build.bash run.bash join.bash

./build.bash cloudsim_sim --no-cache

./run.bash cloudsim_sim cloudsim_sim.ign robotName1:=X1 robotConfig1:=X1_SENSOR_CONFIG1 robotName2:=X2 robotConfig2:=X2_SENSOR_CONFIG2

Terminal 2: Build and run the cloudsim_bridge docker image

This is the docker image that corresponds to the "Bridge Container" on the Cloudsim architecture:

cd ~/subt_ws/src/subt/docker/

chmod +x build.bash run.bash join.bash

./build.bash cloudsim_bridge --no-cache

./run.bash cloudsim_bridge robotName1:=X1 robotConfig1:=X1_SENSOR_CONFIG1 robotName2:=X2 robotConfig2:=X2_SENSOR_CONFIG2

Terminal 3: Run X1 controller

This is where a team would run their own controller. For X1 in this case, we are just running it from a catkin workspace. However, teams will run their controller within their Solution Container.

roslaunch subt_example example_robot.launch name:=X1

Terminal 4: Run X2 controller

Same for X2, we also run it from a catkin workspace. However, as indicated above, teams will run their controller within their Solution Container.

roslaunch subt_example example_robot.launch name:=X2

Terminal 5: Test!

1) Test the comms network.

rostopic pub /X2/comm std_msgs/String "X1"

This should cause output in Terminal 3 (X1 controller) similar to:

[ INFO] [1563661130.260521094, 1.903000000]: CommClientCallback

2) Test movement by driving the X1 forward:

rostopic pub /X1/cmd_vel geometry_msgs/Twist '{linear:  {x: 0.1, y: 0.0, z: 0.0}}'

Back to Getting Started

Updated