A simple, but powerful toolset for various ROS2 utilities, with full UI and partial CLI support.
A simple, but powerful toolset for various ROS2 utilities, with full UI and partial CLI support.
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.
The most important information can be found here:
Below is a list of all tools which are currently available in the ros2_utils_tool:
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 to YAML
Export bag topic messages to one or multiple yaml files.
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
Record Bag
Record a ROS bag, UI based. Supports topic and service 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
Play Bag
Play a bag file, UI based. Supports topic and service 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)[!Note]
This package still is in active development. More tools might be added later in the future, while already existing ones might expand and change constantly.
A working ROS2 distribution is required. As of now, jazzy, kilted, lyrical 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.15.0, humble is no longer supported and won't receive any more feature updates. However, critical bugfixes will still be included (see thehumblebranch).
The following packages are required to be installed manually:
The following packages are also required, but should be installed automatically with ROS:
The following packages are optional:
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.
cd path/to/your/workspace/srcgit clone https://github.com/MaxFleur/ros2_utils_tool.gitcd path/to/your/workspace/colcon buildAlways source your workspace first:
source install/setup.bashros2 run ros2_utils_tool tool_uiFor 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).
Bag to YAML Tool:
ros2 run ros2_utils_tool tool_message_to_yaml /path/to/bag /path/to/yaml_dir(Note that a topic can be specified optionally. If no topic is specified, the first available 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_bagDummy 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 Integer, Image or PointCloud, String or TF2, up to five 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/bagPublish 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_testsThe 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 themainbranch is only updated for new versions or critical bugfixes, thedevelopbranch is the most current one, providing the newest updates and features. So please open a merge request withdevelopas the target branch.
No open issues yet, or sync has not completed.