Skip to content

Breadcrumbs and communication visualization tutorial

Carlos Agüero edited this page May 13, 2020 · 23 revisions

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 the communications.

Requirements

In this tutorial, we assume that you installed SubT following the Catkin workspace installation. We'll follow the previous tutorial except that we'll use a custom breadcrumb_models_caguero branch to visualize the communications in Gazebo.

We'll need to teleoperate a robot, make sure that you can do it following the example setup tutorial.

In order to enable the communication visualization tool we need to install Ignition Citadel, as this feature is only available in Ignition Gazebo 3.X .

sudo apt remove ignition-blueprint
sudo apt install ignition-citadel

We'll also need to make sure that the ign_ros bridge is linked against the Ignition Transport installed in Citadel, so we'll compile from source:

cd ~/subt_ws/src/subt
git pull
git checkout breadcrumb_models_caguero
cd ..
git clone https://github.com/osrf/ros_ign.git
git checkout melodic

Now, let's recompile SubT and the ign_ros with Ignition Citadel:

. /opt/ros/melodic/setup.bash
cd ~/subt_ws/
rm -rf build devel
catkin_make install

Deploy a breadcrumb and visualize communications

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 cave_circuit.ign worldName:=simple_cave_01 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 10000 --req 'data: "X2"'

Zoom out the scene to visualize a bigger part of the cave, and you should observe something similar to the next picture:

before_breadcrumb.png

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
roslaunch subt_example teleop.launch

Now, use the joystick to teleoperate the robot through the cave until you reach the next three way intersection:

deploy_breadcrumb.png

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 again the command that updates the communication visualizer:

ign service -s /subt/comms_model/visualize --reqtype ignition.msgs.StringMsg --reptype ignition.msgs.Boolean --timeout 10000 --req 'data: "X2"'

You should something similar to the next picture:

after_breadcrumb.png

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.