Skip to content

Repository files navigation

tachy-reader

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.

Features

  • 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_publish and on_complete hooks

Installation

From source (requires Rust toolchain)

pip install git+https://github.com/tachycode/tachy-reader.git@dev

Local development

git clone https://github.com/tachycode/tachy-reader.git
cd tachy-reader
pip install -e .

Prerequisites: Rust toolchain (rustup), Python ≥ 3.8, maturin ≥ 1.5

Quick Start

frommcap_playerimportMcapPlayerwithMcapPlayer("/path/to/recording.mcap") asplayer:
# Blocking playback at 2x speedplayer.play(rate=2.0)

Non-blocking playback

withMcapPlayer("recording.mcap") asplayer:
player.play_async(rate=1.0)
whileplayer.state!="finished":
print(f"Progress: {player.progress:.1%}")
time.sleep(1.0)

Topic filtering

player=McapPlayer(
"recording.mcap",
topics=["/camera/image_raw", "/imu/data"],
topic_prefix="/replay",
)

Playback control

player.play_async()
player.pause()
player.seek(10.5) # jump to 10.5 secondsplayer.set_rate(0.5) # half speedplayer.resume()
player.stop()

API Reference

McapPlayer

ParameterTypeDescription
mcap_pathstrPath to .mcap file
node_namestrROS2 node name (default: "mcap_player")
topic_prefixstrPrefix for published topics
topicslist[str]Whitelist of topics to publish
exclude_topicslist[str]Topics to skip
qos_overridesdictPer-topic QoS profiles
on_publishCallableCalled after each message publish
on_completeCallableCalled when playback finishes
nodeNodeExisting rclpy Node (optional)

Properties

PropertyTypeDescription
current_timefloatCurrent position in seconds
progressfloatPlayback progress (0.0 – 1.0)
statestr"idle", "playing", "paused", "finished"
durationfloatTotal file duration in seconds
topics_infodictTopic metadata {name: (msg_type, encoding)}

License

Apache-2.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages