Convert MCAP Bags to a LeRobot Dataset#

This tutorial will guide you on how to convert the MCAP recordings produced by Record Demonstrations into a LeRobot dataset that the GR00T N fine-tuning script can consume.

This tutorial can be run on an x86_64 workstation or Jetson AGX Thor. The converter is pure Python so no GPU is required. The MCAP-to-LeRobot converter does not require a ROS installation, thus you can run it in the Isaac ROS container or also directly on your host.

Clone the data-tools repository and install the converter on the host with uv:

cd ${ISAAC_ROS_WS}/src && \
   git clone -b release-4.5 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_data_tools.git isaac_ros_data_tools
cd ${ISAAC_ROS_WS}/src/isaac_ros_data_tools/isaac_ros_mcap_lerobot_converter
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e .

Run the conversion against the recordings directory:

Note

mcap-to-lerobot fails if --output-dir already exists. Before re-running, remove it with rm -r ${ISAAC_ROS_WS}/recordings/lerobot_output.

mcap-to-lerobot \
    --rosbags-dir ${ISAAC_ROS_WS}/recordings/session_<TIMESTAMP> \
    --output-dir ${ISAAC_ROS_WS}/recordings/lerobot_output \
    --task "move the apple to the plate" \
    --fps 30 --robot-type unitree_g1

Replace <TIMESTAMP> with the session you want to convert.

To merge several recording sessions into one dataset, repeat --rosbags-dir:

mcap-to-lerobot \
    --rosbags-dir ${ISAAC_ROS_WS}/recordings/session_A \
    --rosbags-dir ${ISAAC_ROS_WS}/recordings/session_B \
    --rosbags-dir ${ISAAC_ROS_WS}/recordings/session_C \
    --output-dir ${ISAAC_ROS_WS}/recordings/lerobot_output \
    --task "move the apple to the plate" \
    --fps 30 --robot-type unitree_g1

Episodes are numbered sequentially across the supplied sessions in the order given.

See also

isaac_ros_mcap_lerobot_converter — full CLI reference, output layout, --fps / sync_rate rationale.

Next#

Continue with Fine-Tune GR00T N to fine-tune a GR00T N policy on the converted dataset.