Roboflow is a universal, schema-driven runtime decoding engine for robotics data. Convert between ROS bag files, MCAP, and different message formats with a simple fluent API.
use roboflow::Robocodec;
// Convert ROS bag to MCAP
Robocodec::open(vec!["input.bag"])?
.write_to("output.mcap")
.run()?;import roboflow
# Convert ROS bag to MCAP
result = roboflow.Roboflow.open(["input.bag"]) \
.write_to("output.mcap") \
.run()# Convert between formats
convert input.bag output.mcap
# Inspect file contents
inspect data.mcap
# Extract specific topics
extract data.bag --topics /camera/image_raw --output extracted/Note: PyPI and crates.io packages are being prepared. For now, build from source (see CONTRIBUTING.md).
Add to Cargo.toml:
[dependencies]
roboflow = "0.1"For the format library only:
[dependencies]
robocodec = "0.1"pip install roboflow- Multi-Format Support: CDR (ROS1/ROS2), Protobuf, JSON
- File Format Support: MCAP, ROS1 bag (read/write)
- Schema Parsing: ROS
.msg, ROS2 IDL, OMG IDL - Cross-Language: Rust and Python APIs with full feature parity
- High-Performance: Parallel processing pipelines up to ~1800 MB/s
- Data Transformation: Topic renaming, type normalization, format conversion
| Format | Read | Write | Notes |
|---|---|---|---|
| MCAP | ✅ | ✅ | Robotics data format optimized for appending |
| ROS1 Bag | ✅ | ✅ | ROS1 rosbag format |
| CDR | ✅ | ✅ | Common Data Representation (ROS1/ROS2) |
| Protobuf | ✅ | ✅ | Protocol Buffers |
| JSON | ✅ | ✅ | JSON serialization |
- ROS
.msgfiles (ROS1) - ROS2 IDL (Interface Definition Language)
- OMG IDL (Object Management Group)
use roboflow::{Robocodec, pipeline::fluent::CompressionPreset};
// Process multiple files
Robocodec::open(vec!["a.bag", "b.bag"])?
.write_to("/output/dir")
.with_compression(CompressionPreset::Fast)
.run()?;use robocodec::TransformBuilder;
let transform = TransformBuilder::new()
.with_topic_rename("/old_topic", "/new_topic")
.build();
Robocodec::open(vec!["input.bag"])?
.transform(transform)
.write_to("output.mcap")
.run()?;Robocodec::open(vec!["input.bag"])?
.write_to("output.mcap")
.hyper_mode()
.run()?;
⚠️ Experimental: APIs may change between versions.
Convert robotics data to KPS dataset format:
roboflow convert to-kps input.mcap ./output/ config.toml| Tool | Description |
|---|---|
convert |
Convert between bag/MCAP formats |
extract |
Extract data from files |
inspect |
Inspect file metadata |
schema |
Work with schema definitions |
search |
Search through data files |
- Architecture - High-level system design
- Pipeline - Async pipeline architecture
- Memory Management - Zero-copy and arena allocation
- Contributing - Development setup and guidelines
We welcome contributions! See CONTRIBUTING.md for development setup and guidelines.
This project is licensed under the MulanPSL v2 - see the LICENSE file for details.
Robocodec was originally developed as part of the Strata robotics platform.