How to visualize soccer markers

This package contains nodes that convert ROS2 Soccer Interfaces msgs to RViz Markers that allow visualization of soccer-related topics. Instructions here run each node in isolation, to run all nodes from a launch file, see Launch all Conversion Nodes.

Publish test data

In a new terminal, start by simulating incoming vision data:

ros2 topic pub vision/ball soccer_object_msgs/msg/Ball '{header: {frame_id: test_frame}, center: {x: 2.0, y: 1.0, z: 0.0}}'

Note

In this tutorial, we’re publishing data in the test_frame frame. On a real robot, this frame would most likely be a frame such as camera, or wherever the vision data is relative to.

Run conversion node

In a new terminal, run the corresponding node to convert vision data to visualization markers:

ros2 run soccer_marker_generation ball_to_marker

Tip

To run all nodes from a launch file, see Launch all Conversion Nodes.

Open RViz

In a new terminal, open RViz:

rviz2

Change Fixed Frame

Set Global Options > Fixed Frame to test_frame.

_images/test-frame.gif

Note

Ideally, fixed frame is set to map, or world. In this tutorial, we don’t have a transform from test_frame to any of those frames. By setting fixed frame to test_frame, we don’t have to publish any transforms to visualize the data.

Add Marker to Display

In Rviz, add a new Marker display, and set topic to visualization/ball.

_images/ball.gif