-
Notifications
You must be signed in to change notification settings - Fork 97
Breadcrumbs and communication visualization tutorial
As described in the API documentation, breadcrumbs can be deployed to extend the communication range of your team. In this tutorial, we'll guide you through the process of deploying a breadcrumb and visualizing its impact on communications. For further details on how the communication model works, check out the Communication Model Tutorial.
We assume that you installed SubT following the Catkin workspace installation.
We'll need to teleoperate a robot; make sure that you can do it following the example setup tutorial. We will use the ROS teleop-twist-keyboard package to move a robot.
sudo apt-get install ros-melodic-teleop-twist-keyboard
It's time to launch SubT spawning X1
and X2
. Note that we'll use X1_SENSOR_CONFIG_7
, a configuration that adds breadcrumbs to X1
. Open a new terminal and run:
cd ~/subt_ws/
. install/setup.bash
ign launch -v 4 competition.ign worldName:=simple_cave_01 circuit:=cave robotName1:=X1 robotConfig1:=X1_SENSOR_CONFIG_7 robotName2:=X2 robotConfig2:=X2_SENSOR_CONFIG_1
Next, we're going to use the tool to visualize the communications. Open a new terminal and run:
cd ~/subt_ws/
. install/setup.bash
ign service -s /subt/comms_model/visualize --reqtype ignition.msgs.StringMsg --reptype ignition.msgs.Boolean --timeout 100000 --req 'data: "X2"'
Zoom out of the scene to visualize a bigger part of the cave. You should observe something similar to the next picture:
The scene now contains colored dots showing the areas of the cave that are within the communication range from X2
. The colors show the intensity of the signal. In the rest of the tutorial, we'll teleoperate X1
into the cave, deploy a breadcrumb, and then, update the communication visualizer to see the effect of the breadcrumb.
Open a new terminal and type:
cd ~/subt_ws/
. install/setup.bash
rosrun teleop_twist_keyboard teleop_twist_keyboard.py /cmd_vel:=/X1/cmd_vel
Now, use the keyboard to teleoperate the robot through the cave until you reach the first three-way intersection:
Let's deploy our breadcrumb! Open a new terminal and type:
cd ~/subt_ws/
. install/setup.bash
rostopic pub /X1/breadcrumb/deploy std_msgs/Empty "{}" --once
You should observe a breadcrumb falling to the ground from the rear part of X1
. Now, go back to your second terminal and run the command that updates the communication visualizer again:
ign service -s /subt/comms_model/visualize --reqtype ignition.msgs.StringMsg --reptype ignition.msgs.Boolean --timeout 10000 --req 'data: "X2"'
You should see something similar to the next picture:
Notice that what we're visualizing is the communication range from X2
, that is still at the starting area. You'll see that there are new colored sections, showing that the communication range has been extended.