Package to extract data from S3E Dataset ROS 2 bags into standard file formats in organized folders.
Extracts the following topics to files:
- Compressed Images (
sensor_msgs/msg/CompressedImage) ->.jpg - Raw Images (
sensor_msgs/msg/Image) ->.jpg - LiDAR PointClouds (
sensor_msgs/msg/PointCloud2) ->.bin(compatible with KITTI format: x, y, z, intensity, ring, time) - IMU Data (
sensor_msgs/msg/Imu) ->.txt(timestamp, roll, pitch, yaw, angular_vel, linear_accel) - GPS Data (
sensor_msgs/msg/NavSatFix) ->.txt(timestamp, lat, lon, alt, covariance)
- ROS 2 (tested on Humble/Foxy)
- OpenCV
rosbag2_cpp,cv_bridge,image_transport,tf2
Clone into your workspace src folder:
cd ~/ros2_ws/src
git clone https://github.com/MikeDegany/s3e_extractor.git
cd ..
colcon build --symlink-install --packages-select s3e_extractor # --event-handlers console_direct+
source install/setup.bashDownload the S3E Dataset 
The package includes a launch file specifically designed for the S3E dataset structure (Alpha, Bob, Carol robots).
ros2 launch s3e_extractor s3e_extract.launch.py bag:=/path/to/your/dataset.db3Arguments:
bag: Full path to the.db3file (or metadata.yaml).folder(optional): Output directory. Defaults to anextractedfolder in the same location as the bag file.
Output Structure: The extractor creates a hierarchical folder structure:
extracted/
├── Alpha/
│ ├── left_camera/
│ ├── right_camera/
│ ├── velodyne_points/
│ ├── imu/
│ └── gps/
├── Bob/
│ └── ...
└── Carol/
└── ...
You can also run individual extractors for specific topics.
Example: Extract Compressed Image
ros2 run s3e_extractor Comimg2jpg --ros-args \
-p bag:=/path/to/bag.db3 \
-p topic:=/camera/image/compressed \
-p folder:=/output/folder/ \
-p start_time:=-1.0 \
-p end_time:=-1.0Available Nodes:
Comimg2jpg: Compressed Imagesimg2jpg: Raw Imagespc2bin: PointCloud2 (supports Velodyne, Ouster, Livox, Hesai vialidar_typeparam)imu2txt: IMUgps2txt: GPS
This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
This package is largely based on and adapted from rosbag_extractor by thisparticle. I thank the original authors for their work.