Skip to content

LCAS/ros2_topic_monitor

Repository files navigation

ROS2 Topic Monitor

A simple GUI tool designed to check if a desired topic is being published. The interface will periodically update to reflect the current status.

Installation

To get the package, please clone it into your ROS 2 workspace as follows:

cd <your_ros2_ws>/src
git clone https://github.com/LCAS/ros2_topic_monitor.git
cd ..
colcon build --packages-select ros2_topic_monitor
source install/setup.bash  

This package will be released later

Nodes

This tool consists of two nodes:

Monitoring Node

To launch the monitoring node, use the following command:

ros2 launch ros2_topic_monitor monitor.launch.py

The above command will launch the following GUI, where the photo on the left when there are no topics available and on the right with the available topics:

Topics Not Being Published Topics Being Published

The GUI can dynamically adapt to new topics by adding them to the configuration file here. All topics need to be added under the 'sensors' section. Here is an example:

sensors:
  - name: "GPS odom"
    topic: "/gps_base/odometry"
    message_type: "nav_msgs.msg.Odometry"

Where the name attribute is used to display it in the GUI, and the topic is the topic that needs to be subscribed to. It is important to set the message_type.

There is no need to explicitly set the 'QoS' as the node uses 'qos_profile_sensor_data' when it subscribes to the topic, as shown here.

Recording Node

To launch the recording node, use the following command:

ros2 launch ros2_topic_monitor record.launch.py

While will give the following GUI where you can define the recording path and the bag name:

Record GUI

The topics to be recorded need to be added into this config file.