Zero-service MCAP playback library for ROS2. Rust core (via PyO3) with a pure-Python API.
No DDS services are registered — all playback control happens via in-process method calls, keeping the ROS2 graph clean.
- Rust-powered core: memory-mapped MCAP reading with zero-copy message access
- Zero ROS2 services: no parameter/logger/type-description services polluting the graph
- Simple API: context-manager pattern, blocking or async playback
- Playback control: play, pause, resume, stop, seek, rate adjustment
- Topic filtering: include/exclude specific topics
- QoS overrides: per-topic QoS profile configuration
- Callbacks:
on_publishandon_completehooks
pip install git+https://github.com/tachycode/tachy-reader.git@devgit clone https://github.com/tachycode/tachy-reader.git
cd tachy-reader
pip install -e .Prerequisites: Rust toolchain (
rustup), Python ≥ 3.8, maturin ≥ 1.5
frommcap_playerimportMcapPlayerwithMcapPlayer("/path/to/recording.mcap") asplayer:
# Blocking playback at 2x speedplayer.play(rate=2.0)withMcapPlayer("recording.mcap") asplayer:
player.play_async(rate=1.0)
whileplayer.state!="finished":
print(f"Progress: {player.progress:.1%}")
time.sleep(1.0)player=McapPlayer(
"recording.mcap",
topics=["/camera/image_raw", "/imu/data"],
topic_prefix="/replay",
)player.play_async()
player.pause()
player.seek(10.5) # jump to 10.5 secondsplayer.set_rate(0.5) # half speedplayer.resume()
player.stop()| Parameter | Type | Description |
|---|---|---|
mcap_path | str | Path to .mcap file |
node_name | str | ROS2 node name (default: "mcap_player") |
topic_prefix | str | Prefix for published topics |
topics | list[str] | Whitelist of topics to publish |
exclude_topics | list[str] | Topics to skip |
qos_overrides | dict | Per-topic QoS profiles |
on_publish | Callable | Called after each message publish |
on_complete | Callable | Called when playback finishes |
node | Node | Existing rclpy Node (optional) |
| Property | Type | Description |
|---|---|---|
current_time | float | Current position in seconds |
progress | float | Playback progress (0.0 – 1.0) |
state | str | "idle", "playing", "paused", "finished" |
duration | float | Total file duration in seconds |
topics_info | dict | Topic metadata {name: (msg_type, encoding)} |
Apache-2.0