Announcing rosetta: a ROS 2 ⇄ LeRobot bridge
LeRobot is great for experimenting with state-of-the-art policies and sharing datasets/pretrained models. But actually using or fine-tuning those models on ROS 2 robots isn’t easy.
I’m working on rosetta, a ROS 2 package that helps LeRobot models play nicely with ROS 2 robots.
What’s inside
- EpisodeRecorderServer — Action-driven recording to rosbag2; each episode stores a task/prompt in bag metadata for later export.
bag_to_lerobot.py
— Converts one or more bags into a ready-to-train LeRobot v3 dataset (Parquet + MP4 with rich metadata).- PolicyBridge — Runs a pretrained LeRobot policy at the contract rate, subscribes to ROS 2 topics as observations, and publishes actions (e.g.,
geometry_msgs/Twist
). - Contract YAML — Assigns which topics are used as observations and which are used as actions (plus specifics on handling, timing, and rates). The same contract is used consistently from data collection through to inference to keep everything aligned.
A simple example to start
I’ve posted a TurtleBot3 demo dataset (53 short episodes) and a lightweight ACT checkpoint trained on that data for a couple hours on a laptop. It’s far from a great dataset (I crash during training in places and kept the episode count modest), but it should help you get going—then swap in your robot by editing the contract and start iterating.
- Dataset: https://huggingface.co/datasets/iblnk/turtlebot3_demo
- Model (ACT): https://huggingface.co/iblnk/act-turtlebot3_demo
What’s next
I’ve got a backlog I’m actively working through:
- More built-in decoders/encoders for common message types
- A refactor into separate client/policy composable nodes
- Leveraging an async policy server so inference can run off-robot (no ROS 2 on the GPU box)
- Fixes for a growing list of bugs
I’d love feedback
Thanks for taking a look!