Usage

Warning

Remember to source your workspace with . install/local_setup.bash

Opening

You have the option of Running RQt Image Overlay as either a:

  • Standalone Application

  • RQt Widget

Open a new terminal and run RQt:

rqt

Warning

If this is the first time opening rqt since you’ve sourced the setup file, run rqt --force-discover instead.

From the menu bar, select Plugins > Debugging > Image Overlay:

_images/selecting_plugin.png

You should see a dockable widget show up like the following:

_images/plugin_in_rqt.png

Publishing Images

You need a node that publishes images on a topic to display. Publish images on a topic using one of the following:

  • V4L2 Node - Recommended, only works if you have a webcam

  • Image Publisher Node

  • Your own node that publishes images on any topic

In this option, you will use the v4l2_camera package to publish images from your webcam. To install the package, run:

sudo apt install ros-${ROS_DISTRO}-v4l2-camera

Tip

${ROS_DISTRO} gets automatically substituted with the name of your ROS2 distro (eg. rolling, galactic, etc.) if you have sourced your ROS2 installation.

To start the v4l2 camera node, run:

ros2 run v4l2_camera v4l2_camera_node

Displaying the Images

Tip

In a separate terminal, check that the image is being published correctly by running:

ros2 topic list -t

Make sure /image_raw [sensor_msgs/msg/Image] shows up in the list of topics.

Go to the window with the RQt Image Overlay that you opened in the Opening section.

Click on the refresh button to update the list of image topics. Opening the drop-down, you should see all topics detected publishing sensor_msgs/Image. In this example, /image_raw is the only topic listed.

_images/image_combo_box.png

Select the topic /image_raw, you should see the output of your webcam showing in the bottom half of your RQt Image Overlay, as below:

_images/v4l2_image.png

What’s next?

Next, you must create a layer to display your message type. Continue onto Creating a Layer.