OpenRAL dataset bridge — RolloutRecorder + LeRobotDataset v3 / rosbag2 sinks for every skill execution
Project description
openral-dataset
openral-dataset — rosbag2 ↔ LeRobotDataset v3 bridge. Every skill execution (sim
or hardware) becomes a row in a LeRobotDataset v3.0 (codebase_version="3.0",
lerobot>=0.5.1). Successful and failed episodes are both persisted; the
per-row next.success flag and the per-dataset meta/info.json["metadata"] ["dataset_success_rate"] let downstream consumers filter.
Public API
from openral_core import RobotDescription
from openral_dataset import LeRobotDatasetSink, RolloutRecorder
robot = RobotDescription.from_yaml("robots/so100_follower/robot.yaml")
sink = LeRobotDatasetSink(
root="/tmp/ds",
robot=robot,
fps=30.0,
repo_id="openral/dataset-pick-cube",
license="CC-BY-4.0",
)
with RolloutRecorder(
robot=robot,
task_string="pick the cube",
fps=30.0,
sinks=[sink],
repo_id="openral/dataset-pick-cube",
) as rec:
rec.episode_start()
# for each tick:
rec.record_frame(
observation_state=state_vec, # (state_dim,) float32
images={"camera1": rgb_frame}, # camera_key → (H, W, 3) uint8
action=action_vec, # (action_dim,) float32
reward=0.0,
terminated=False,
truncated=False,
)
rec.episode_end(success=True)
Components
RolloutRecorder— in-memory per-rollout accumulator with multi-sink fan-out. Writes theopenral.dataset.repo_id/episode_idx/frame_idxOTel attributes on the activerskill.tickspan so the Jaeger trace can be joined to the on-disk frame.DatasetSinkProtocol — every sink (online / offline) implementsopen_episode/write_frame/close_episode/finalize.LeRobotDatasetSink— wraps the reallerobot.datasets.LeRobotDataset.create / add_frame / save_episode / finalize. Lazy-imports lerobot; raisesROSConfigErrorwith an install hint when lerobot is absent.features_from_robot— pureRobotDescription→ LeRobot v3 features dict mapping. No I/O, no lerobot import.
The rest of the dataset-bridge PR series has since landed:
- PR2 (partial) —
SensorRosPublisherinpython/sensors/(ros_publisher.py) ships and is tested. The wrappingpackages/openral_sensors_ros/lifecycle node specified by the dataset-bridge design is not yet built, so feeding live camera topics into a recorder on the hardware path is the one remaining gap. - PR3 ✅ —
Rosbag2Sink(mcap, daemon writer thread) +openral_msgs/Tick/openral_msgs/EpisodeIDLs + explicitepisode_start/episode_endAPI onDeployRunner(bag.py). - PR4 ✅ —
Rosbag2ToLeRobotConverter.from_bag+openral dataset from-bagCLI subcommand (converter.py). - PR5 ✅ —
openral dataset pushwith consent prompt +_hf_publishshared helper de-duped fromtools/rskill_publisher.py.
CLI surface
Sim path — openral sim run accepts three flags (PR1):
--dataset-out PATH— write a LeRobotDataset v3 toPATHas the sim runs. Path must not pre-exist; lerobot v3 refuses to write into a populated root.--dataset-repo-id STR— repo id stored inmeta/info.json. Defaults toopenral/dataset-<robot_id>. Not pushed byopenral sim run;openral dataset pushowns publishing.--dataset-license SPDX— defaults toCC-BY-4.0(the LeRobot convention). PII-bearing datasets must set a more restrictive license; theopenral dataset pushconsent prompt enforces this.
Hardware / rosbag path — record on a live ROS 2 graph, then convert offline:
openral record --profile slim|full --out DIR— wrapros2 bag recordwith curated topic profiles (mcap storage).--dry-runprints the composed argv without a sourced ROS 2 install.openral dataset from-bag BAG --robot robot.yaml --output DS— replay aRosbag2Sinkmcap into a LeRobotDataset v3 (--repo-id/--license/--fpsoptional). PR4.openral dataset push DS [--repo-id ID] [--yes] [--dry-run]— consent-gated upload of a local dataset root to the HF Hub. PR5.
Verification
uv run pytest python/dataset/tests/ -v
uv run mypy --strict -p openral_dataset
uv run ruff check python/dataset/
End-to-end against a real lerobot.datasets.LeRobotDataset v3.0 round-trip:
uv run pytest python/dataset/tests/test_sink_lerobot.py -v
Per CLAUDE.md §1.11 (no mocks): every test loads the real SO-100
RobotDescription from robots/so100_follower/robot.yaml and exercises the
real lerobot.datasets.LeRobotDataset writer. Tests pytest.skip with a
typed reason on hosts without lerobot>=0.5.1 installed (it lives behind
the libero / metaworld dependency groups today).
Coverage scope
- Sim path is covered end-to-end:
tests/sim/test_dataset_emission.pydrivesopenral sim run --dataset-outagainstaloha_transfer_cube.yamlwith real ACT weights + gym-aloha physics + SVT-AV1 video encoding, then re-opens the produced v3 dataset (CUDA +lerobot+gym_alohagated; skips on CPU/CI). - Hardware / rosbag path is covered only in unit isolation:
tests/unit/test_deploy_runner_dataset_recording.pydrivesDeployRunner+Rosbag2Sinkdirectly, plus the converter / CLI unit tests. It has not been exercised throughopenral deploy simor a live ROS 2 graph — the deploy-sim node (rskill_runner_node.py) does not yet construct or attach aRolloutRecorder.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openral_dataset-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openral_dataset-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
601634d1f1da43354a8addf4bee9867c883249fcd5b412cd2e0dd9f0209b3a35
|
|
| MD5 |
715bfa761ae1efea2349e016459e5e95
|
|
| BLAKE2b-256 |
7b9aeebdf069553d40f9a94106e617c76eb2694f7e546e02366a713de219c17b
|