| Crates.io | rustbag |
| lib.rs | rustbag |
| version | 0.1.1 |
| created_at | 2025-11-14 17:07:44.60336+00 |
| updated_at | 2025-11-14 17:13:44.942218+00 |
| description | A high-performance ROS 2 bag player |
| homepage | https://github.com/iv461/rustbag |
| repository | https://github.com/iv461/rustbag |
| max_upload_size | |
| id | 1933167 |
| size | 290,283 |

A new rosbag player for ROS 2. It solves the problem that the original rosbag player struggles with high-bandwidth data and can't replay multiple rosbags reliably (#2158).
Advantages over the original player (rosbag2)
Reliably plays multiple Rosbags without starvation issues.
Improved reading algorithm: - Uses constant time rather than constant message count lookahead when reading, making it independent of frequency differences among topics (#2158).
Robust and clean asynchronous code. The reader thread sends messages to the publisher thread via message passing, which eliminates starvation and deadlock bugs systematically (such as #2156). Rust's channels are a perfect fit here.
Overall simpler implementation
It currently supports only the (default) mcap format: If you still have files in the legacy SQLite format, I recommend converting them first to MCAP using rosbags.
First, install Rust/Cargo: https://rust-lang.org/tools/install/
cargo install rustbag
# add cargo bin folder to your path so that the rustbag command is found (add this line your ~/.bashrc)
export PATH=$PATH:~/.cargo/bin/
git clone https://github.com/iv461/rustbag
cd rustbag
cargo install --path .
# add cargo bin folder to your path so that the rustbag command is found (add this line your ~/.bashrc)
export PATH=$PATH:~/.cargo/bin/
You then need to source the ROS environment.
The CLI and the keyboard controls are almost the same as the original rosbag player.
The only difference is that no -i flag is required for multiple rosbag files.
For example:
rustbag path/to/rosbag1 path/to/rosbag2 --clock --topics /sensing/lidar/pointcloud_raw /camera/center/image_rect/compressed --remap /tf:=/tf_old -l -r 0.5
Note: rustbag uses memory mapping for reading the files. This makes it appear to have an unreasonably high memory usage compared to rosbag2.
.mcap.zstd)/clock topicrosbag2 has quite an has an extensive feature set, PRs are welcome to add these missing features:
Only supports the mcap format
Replaying services
Bag split
Wait for all publishers to receive the ACK (r2r limitation)
Disabling keyboard controls (Useful only if it was a composable node/module (https://github.com/ros2/rosbag2/pull/1607))
QoS overrides (but /tf_static is always published with correct QoS)
Controlling playback via services
Delay before start (Just pause before play)
Start paused (Just pause before play)
Delay before each message (Just use rate)
Choosing which topics trigger /clock (I see no use for this feature)
Does not adapt serialization format: As all DDS-based RMWs as well as Zenoh use the same serialization format (CDR), , this is de facto not a problem
Pull requests for bugfixes and for adding missing features that rosbag2 has are welcome. Please create an issue first to discuss your use-case before creating a pull request.
This software is released under the Apache-2 license.
The Rosbag2 project was a helpful reference for this project, particularly with regard to the keyboard controls and player clock. Rosbag2 is licensed under the Apache-2 licence.