A tool for converting Stereolabs ZED camera SVO(2) recordings to MCAP format, enabling seamless visualization in Foxglove Studio.
The resulting MCAP files can be visualized in Foxglove Studio or processed with ROS2 tools.
This utility converts ZED camera SVO recordings (.svo
/.svo2
files) to MCAP format (.mcap
files). The tool only supports the following camera data:
- Regular camera images (RGB/grayscale)
- Depth maps
- Point clouds
- Camera calibration information
The tool supports multiple ZED cameras and customizable output configurations through a YAML-based configuration system.
- High-performance: Multi-threaded message processing for efficient conversion
- Flexible configuration: YAML-based configuration for cameras and output settings
- Multiple data types: Support for images, depth maps, point clouds, and more
- Progress tracking: Real-time conversion progress display with FPS monitoring
- ROS2 compatibility: Outputs standard ROS2 message types for maximum compatibility
- CMake (3.5 or newer)
- ZED SDK
- CUDA (compatible with your ZED SDK version)
- ROS2 dev libraries (std_msgs, sensor_msgs, rclcpp)
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build --parallel
Create a configuration file (e.g., config.yaml
) and run:
./svo_to_mcap config.yaml
You can press Ctrl+C at any time to gracefully terminate the conversion process.
The tool uses YAML configuration files. Here's an example:
cameras:
- name: zed_camera_1
svo_file: /path/to/cam1_recording.svo
settings:
depth_mode: NEURAL
coordinate_units: METER
channels:
- name: left
type: VIEW::LEFT
- name: right
type: VIEW::RIGHT
- name: depth
type: MEASURE::DEPTH_U16_MM
- name: point_cloud
type: MEASURE::XYZRGBA
- name: zed_camera_2
svo_file: /path/to/cam2_recording.svo
channels:
- name: right
type: VIEW::RIGHT
output:
file: output.mcap
compression: lz4 # Options: zstd, lz4, none
name
(required): Camera identifier (used for output channel naming)svo_file
(required): Path to the SVO recording filechannels
: List of data channels to extractsettings
: Camera settingsdepth_mode
: Depth mode, corresponds to ZED SDK enum sl::DEPTH_MODE (Defaults is NONE)coordinate_units
: Coordinate units, corresponds to ZED SDK enum sl::UNIT (Default is METER)
Channels can be one of two types (sl::VIEW or sl::MEASURE):
-
VIEW types (prefixed with
VIEW::
):LEFT
,RIGHT
,LEFT_UNRECTIFIED
,RIGHT_UNRECTIFIED
, etc.
-
MEASURE types (prefixed with
MEASURE::
):DEPTH
,DISPARITY
,XYZ
,XYZRGBA
, etc.
See the ZED API documentation for a complete list of VIEW and MEASURE types.
The converter produces an MCAP file with the following ROS2 message types:
sensor_msgs/msg/Image
: For regular images and depth mapssensor_msgs/msg/CameraInfo
: Camera calibration informationsensor_msgs/msg/PointCloud2
: For point cloud data
More messages can easily be added such as IMU, temperature, detected objects etc, but I don't need those (for now).
You can easily merge the converted MCAP file with existing ROS2 recordings using the mcap CLI tool:
mcap merge output.mcap ros2_recording.mcap -o combined.mcap