Skip to content

Adding converstion script from ros format to lerobot format#70

Merged
akshay18iitg merged 14 commits intomainfrom
feat/ros2lerobot
Feb 4, 2026
Merged

Adding converstion script from ros format to lerobot format#70
akshay18iitg merged 14 commits intomainfrom
feat/ros2lerobot

Conversation

@akshay18iitg
Copy link
Contributor

@akshay18iitg akshay18iitg commented Jan 14, 2026

What this does
The PR adds a script to convert the data collected on robot in .mcap format using ros bags to lerobot dataset v2.1 format.
Right now, it only supports joint states. In future it will also support various sensors.

How it was tested
Was able to collect the data and visualzie it in the visualizer using lerobot format

Examples:

Added ros2lerobot.py script in src/opentau/scripts to convert the data collected on robot in .mcap format using ros bags to lerobot dataset v2.1 format.
Defined config to support user specified fps, input directory, output dir and mapping between features and topics
Examples:

python3 src/opentau/scripts/convert_ros_to_lerobot.py --config_path=${workspaceFolder}/configs/dev/ros2lerobot.json
Note: Before submitting this PR, please read the contributor guideline.

Checklist

  • I have added Google-style docstrings to important functions and ensured function parameters are typed.
  • My PR includes policy-related changes.
    • If the above is checked: I have run the GPU pytests (pytest -m "gpu") and regression tests.

@akshay18iitg akshay18iitg self-assigned this Jan 14, 2026
@akshay18iitg akshay18iitg added the feature New feature or request label Jan 14, 2026
Copy link
Collaborator

@shuheng-liu shuheng-liu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments and questions

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a conversion script to transform ROS bag data (in .mcap format) into LeRobot dataset v2.1 format. Currently supports joint states with plans to add support for various sensors in the future.

Changes:

  • Added ROS bag to LeRobot conversion script with timestamp synchronization
  • Defined configuration types (ROSFeature, RosToLeRobotConfig) for feature mapping
  • Added rosbags dependency for MCAP file reading

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/opentau/scripts/convert_ros_to_lerobot.py Main conversion script implementing timestamp synchronization and data extraction from ROS bags
src/opentau/configs/types.py Added ROSFeature dataclass for ROS-to-LeRobot feature mapping
src/opentau/configs/ros2lerobot.py Configuration dataclass for conversion settings including paths, FPS, and feature mappings
pyproject.toml Added rosbags dependency for MCAP file processing
configs/examples/ros2lerobot.json Example configuration file demonstrating joint state conversion setup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

shuheng-liu
shuheng-liu previously approved these changes Feb 4, 2026
@shuheng-liu shuheng-liu self-requested a review February 4, 2026 21:41
@akshay18iitg akshay18iitg merged commit 69d98fe into main Feb 4, 2026
5 checks passed
@akshay18iitg akshay18iitg deleted the feat/ros2lerobot branch February 4, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants