rb2sv is a tool for extracting data from ROS bags and converting it to the Supervisely format.
rb2sv now supports converting a ros2 bag to the following project types with message types listed below:
- Supervisely images project type
sensor_msgs/msg/Image
sensor_msgs/msg/CompressedImage
- Supervisely point_cloud_episodes project type
geometry_msgs/msg/PointCloud2
For images project type, the following message type can be converted to tags:
sensor_msgs/msg/PoseStamped
However, for point_cloud_episodes project type, rb2sv does not support adding tags currently.
Environments
- Python ^3.10
- ROS2 installed
- Poetry installed
Install Python package dependencies with the following command:
poetry install
Clone the repo and install dependencies.
git clone https://github.com/NEWSLabNTU/rb2sv.git
cd rb2sv
poetry shell
poetry install
Source the ROS2 setup script before you start.
source /opt/ros/$ROS_DISTRO/setup.bash
poetry run poe rb2sv [-h] [-q] -c TOOL_CONFIG.yaml
# e.g. poetry run poe rb2sv -c ./examples/example_config.yaml
-c
,--config-file-path
: Required. The path to the configuration file.-q
,--quiet
: No logging during the conversion.-h
,--help
: Show this help message and exit
The config file should be a yaml file with following keys:
bag_path
: Required. The path to the ros2 bag directory you want to convert.project_dir
: Optional. The output directory.project_type
: Required. Supports onlyimages
orpoint_cloud_episodes
now.topic_pairs
: Required. An array of pairs of(content-topic, tag-topic)
to be converted.
See example_config.yaml for example configuration.
The output directory name is default to ./{rosbag-name}-supervisely
. Each topic specified in the configuration yaml file would be treated as a dataset in the converted supervisely project.