The ros2_utils_tool package provides a large set of tools for various ROS2 activities. These include converting operations between bag and file data, UI tools for terminal based operations (for example playing and recording ROS bags) and publishing data from files.
- π¨ UI support: For every tool, full UI support is provided. A comprehensive and intuitive design making use of overarching layout designs, prefilled UI elements and tooltips makes sure that you get everything done as fast as possible.
- π Partial CLI support: For almost any tool there is an official ROS2 or custom CLI option, providing fast and precise operations which can also be used for scripting. Plus, they give you the full hacker experience!
- π Highly optimized: Many tools support multithreading or hardware acceleration, vastly speeding up operations. Additionally, you can configure the CPU usage to prevent your system from slowing down too much.
- πΎ Settings storage: UI elements input can be stored for later reusage, allowing you to easily rerun any tool.
- βοΈ Options: ros2_utils_tool provides additional functions for configuring warnings, input settings and more.
The most important information can be found here:
Note
This package is still under active development, so more tools might be added later in the future. Additionally, already existing tools might expand and change constantly.
| Tool | Description | CLI support |
|---|---|---|
| Conversion tools | ||
| Bag to Video | Export a ROS bag video topic to a video. Supports mp4, mkv and avi. | X |
| Video to Bag | Port a video file to a ROS bag. Supports mp4, mkv and avi. | X |
| Bag to PCDs | Export a ROS bag point cloud topic to a set of pcd files. | X |
| PCDs to Bag | Port a set of PCD files to a ROS bag. | X |
| Bag to Images | Export a ROS bag video topic to an image sequence. Images can be in jpg, png or bmp. | X |
| Bag TF2 to File | Export a ROS bag tf2 topic to a json or yaml file. | X |
| Bag tools | ||
| Edit Bag | Create a bag file out of an existing one via renaming, removing or cropping topics. | |
| Merge Bags | Merge selected topics of two bags into a new bag file. | X |
| Bag Recordings | Record a ROS bag, UI based. Supports topic selection, compression, bag splitting and including hidden/unpublished topics. | X (ros2 bag record) |
| Dummy Bag | Create a ROS bag with dummy message data. Supported message types are images, strings, integers, point clouds and tf2. | X |
| Compress Bag | Compress a bag file. | X |
| Decompress Bag | Decompress a compressed bag file. | X |
| Bag Playing | Play a bag file, UI based. Supports topic selection and interactive commands such as stopping/resuming, rate adjustion and message skipping.. | X (ros2 bag play) |
| Publishing tools | ||
| Video as ROS Topic | Publish a video file to a ROS image message topic. | X |
| Video as ROS Topic | Publish a set of images to a ROS image message topic. | X |
| Send TF2 | Send a static or non-static ROS transformation (tf2). | X |
| Info tools | ||
| Topic/Service information | UI based, show current topics and services with name and type, including publishers and subscribers. | X (ros2 topic list/ros2 service list) |
| Bag Info | UI based bag info vis. | X (ros2 bag info) |
A working ROS2 distribution is required. As of now, jazzy, kilted and rolling are supported. Make sure that your ROS distro is properly sourced:
source /opt/ros/distro_name/setup.bash
Note
As of version 0.14.0, humble is no longer supported and won't receive any more feature updates. However, critical bugfixes will still be included (see the humble branch).
The following packages are required to be installed manually:
- Qt6/Qt5 for all UI features as well as some convenience functionalities.
- catch2_ROS for Catch2-based unit tests with ROS2.
The following packages are also required, but should be installed automatically with ROS:
- OpenCV for writing video files.
- cv_bridge for converting ROS sensor images to cv matrices and vice versa.
- PCL for creating point clouds and converting them from and to ROS messages.
The following packages are optional:
- uncrustify for code formatting.
All dependencies aside from ROS2 can be installed at once using the following command:
sudo apt install libopencv-dev ros-&ROS_DISTRO-cv-bridge libpcl-dev qt6-base-dev qtbase5-dev ros-&ROS_DISTRO-catch-ros2
For example for Jazzy:
sudo apt install libopencv-dev ros-jazzy-cv-bridge libpcl-dev qt6-base-dev qtbase5-dev ros-jazzy-catch-ros2
Alternatively, use rosdep to install all dependencies.
- Navigate to your ROS2 workspace's src direction:
cd path/to/your/workspace/src
- Clone this repository:
git clone https://github.com/MaxFleur/ros2_utils_tool.git
- Navigate back to your workspace:
cd path/to/your/workspace/
- Build the project:
colcon build
Always source your workspace first:
source install/setup.bash
ros2 run ros2_utils_tool tool_ui
For each CLI tool, type -h or --help to get additional information regarding all flags, alongside example commands.
Bag-to-Video-Tool:
ros2 run ros2_utils_tool tool_bag_to_video /path/to/bag /path/to/video
(Note that a topic can be specified optionally. If no topic is specified, the first available video topic is used. The video needs to have an .mp4 or .mkv appendix).
Video-to-Bag-Tool:
ros2 run ros2_utils_tool tool_video_to_bag /path/to/video /path/to/bag
(Note that a topic can be specified optionally. If no topic is specified, a predefined topic name will be taken. The video needs to have an .mp4 or .mkv appendix).
Bag-to-PCDs-Tool:
ros2 run ros2_utils_tool tool_bag_to_pcds /path/to/bag /path/to/pcds
(Note that a topic can be specified optionally. If no topic is specified, the first available point cloud topic is used).
PCDs-to-Bag-Tool:
ros2 run ros2_utils_tool tool_bag_to_pcds /path/to/pcds /path/to/bag
(Note that a topic can be specified optionally. If no topic is specified, a predefined topic name will be taken).
Bag-to-Images-Tool:
ros2 run ros2_utils_tool tool_bag_to_images /path/to/bag /path/to/images
(Note that a topic can be specified optionally. If no topic is specified, the first available video topic is used. image_format needs to be either jpg, bmp or png, jpg is default).
Bag-TF2-to-File-Tool:
ros2 run ros2_utils_tool tool_tf2_to_file /path/to/bag /path/to/output
(Accepted file formats are json or yaml. Note that a topic can be specified optionally. If no topic is specified, the first available tf2 topic is used).
Merge-Bags-Tool:
ros2 run ros2_utils_tool tool_merge_bags path/to/first_bag path/to/second_bag -t1 topic_name_1 (...) -t2 topic_name_2 (...) path/to/output_bag
Dummy-Bag-Tool:
ros2 run ros2_utils_tool tool_dummy_bag path/to/bag topic_type_1 topic_name_1 ... message_count
(Topic type needs to be String, Integer, Image or PointCloud, up to four topics can be written, message_count needs to be a value from 1 to 1000).
Compress-Bag-Tool:
ros2 run mediassist4_ros_tools tool_compress_bag path/to/uncompressed/source/bag /path/to/compressed/target/bag
(Compression per file is default, use -m message to compress per message).
Decompress-Bag-Tool:
ros2 run mediassist4_ros_tools tool_decompress_bag path/to/compressed/source/bag /path/to/uncompressed/target/bag
Publish-Video-Tool:
ros2 run ros2_utils_tool tool_publish_video path/to/video
(Note that a topic can be specified optionally. If no topic is specified, a predefined topic name will be taken. The video needs to have an .mp4 or .mkv appendix).
Publish-Images-Tool:
ros2 run ros2_utils_tool tool_publish_images path/to/images
(Note that a topic can be specified optionally. If no topic is specified, a predefined topic name will be taken. Images need to be of format jpg, bmp or png).
Send-TF2-Tool:
ros2 run ros2_utils_tool tool_send_tf2
(Translation and rotation are specified using the flags -t and -ro respectively. Transformations are static per default, specifying an additional rate will send a nonstatic one instead).
Unit tests:
ros2 run ros2_utils_tool tool_tests
The ros2_utils_tool package is licensed under EUPLv1.2.
If you discover a new bug or wish for a new feature, feel free to open a new issue.
Note
If you want to contribute another feature, please use the provided Uncrustify file for code formatting. As the main branch is only updated for new versions or critical bugfixes, the develop branch is the most current one, providing the newest updates and features. So please open a merge request with develop as the target branch.


