Skip to content

Cloudsim Catkin

Nate Koenig edited this page Apr 9, 2020 · 2 revisions

The instructions below explain how to setup the sim and bridge to mirror the Cloudsim environment using the catkin workspace for local development and testing. We recommend using Dockercompose to run Cloudsim locally. However, a Catkin setup may meet your development needs, and can allow you access to experimental code.

  1. cloudsim_sim: This runs the simulation testbed.
  2. cloudsim_bridge: This runs a ROS master and the ROS1-Ign bridge.

Prerequisites: Setup the catkin workspace for the SubT Simulation testbed

Open terminal 1 and run cloudsim_sim

cd ~/subt_ws/

source install/setup.bash

ign launch cloudsim_sim.ign robotName1:=X1 robotConfig1:=X1_SENSOR_CONFIG1 robotName2:=X2 robotConfig2:=X1_SENSOR_CONFIG2

Open terminal 2 and run cloudsim_bridge

cd ~/subt_ws/

source install/setup.bash

ign launch cloudsim_bridge.ign robotName1:=X1 robotConfig1:=X1_SENSOR_CONFIG1 robotName2:=X2 robotConfig2:=X1_SENSOR_CONFIG2

Open terminal 3 and run X1 controller

Note: 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

Open terminal 4 and run X2 controller

$ roslaunch subt_example example_robot.launch name:=X2

Open terminal 5 to test the comms network and move the robot

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

# Test movement by driving the X1 forward:

rostopic pub /X1/cmd_vel geometry_msgs/Twist '{linear:  {x: 0.5, y: 0.0, z: 0.0}}'
Clone this wiki locally