LeRobot 文件

NVIDIA IsaacLab Arena & LeRobot

Hugging Face's logo
加入 Hugging Face 社群

並獲得增強的文件體驗

開始使用

NVIDIA IsaacLab Arena & LeRobot

LeRobot EnvHub 現已支援使用 IsaacLab Arena 進行GPU 加速模擬,以實現大規模策略評估。透過高擬真度模擬訓練和評估模仿學習策略 — 所有這些都已整合到 LeRobot 生態系統中。

IsaacLab Arena - GR1 Microwave Environment

IsaacLab Arena 與 NVIDIA IsaacLab 整合,提供以下功能:

  • 🤖 擬人機器人實體:GR1、G1、Galileo,具有多種配置
  • 🎯 操縱與移動式操縱任務:開門、夾取與放置、按鈕等
  • GPU 加速推演:在 NVIDIA GPU 上平行執行環境
  • 🖼️ RTX 渲染:透過擬真渲染、反射和折射評估基於視覺的策略
  • 📦 LeRobot 相容資料集:可供 GR00T N1x、PI0、SmolVLA、ACT 和 Diffusion 策略訓練
  • 🔄 EnvHub 整合:只需一行程式碼即可從 HuggingFace EnvHub 載入環境

安裝

先修條件

硬體需求與 Isaac Sim 相同,詳情請參閱Isaac Sim 需求

  • 支援 CUDA 的 NVIDIA GPU
  • 與 IsaacSim 5.1.0 相容的 NVIDIA 驅動程式
  • Linux (Ubuntu 22.04 / 24.04)

設定

# 1. Create conda environment
conda create -y -n lerobot-arena python=3.11
conda activate lerobot-arena
conda install -y -c conda-forge ffmpeg=7.1.1

# 2. Install Isaac Sim 5.1.0
pip install "isaacsim[all,extscache]==5.1.0" --extra-index-url https://pypi.nvidia.com

# Accept NVIDIA EULA (required)
export ACCEPT_EULA=Y
export PRIVACY_CONSENT=Y

# 3. Install IsaacLab 2.3.0
git clone https://github.com/isaac-sim/IsaacLab.git
cd IsaacLab
git checkout v2.3.0
./isaaclab.sh -i
cd ..

# 4. Install IsaacLab Arena
git clone https://github.com/isaac-sim/IsaacLab-Arena.git
cd IsaacLab-Arena
git checkout release/0.1.1
pip install -e .
cd ..


# 5. Install LeRobot
git clone https://github.com/huggingface/lerobot.git
cd lerobot
pip install -e .
cd ..


# 6. Install additional dependencies
pip install onnxruntime==1.23.2 lightwheel-sdk==1.0.1 vuer[all]==0.0.70 qpsolvers==4.8.1
pip install numpy==1.26.0 # Isaac Sim 5.1 depends on numpy==1.26.0, this will be fixed in next release

評估策略

預訓練策略

以下是可用的已訓練策略

政策 架構 任務 連結
pi05-arena-gr1-microwave PI0.5 GR1 微波爐 HuggingFace
smolvla-arena-gr1-microwave SmolVLA GR1 微波爐 HuggingFace

評估 SmolVLA

pip install -e ".[smolvla]"
pip install numpy==1.26.0 # revert numpy to version 1.26
lerobot-eval \
    --policy.path=nvidia/smolvla-arena-gr1-microwave \
    --env.type=isaaclab_arena \
    --env.hub_path=nvidia/isaaclab-arena-envs \
    --rename_map='{"observation.images.robot_pov_cam_rgb": "observation.images.robot_pov_cam"}' \
    --policy.device=cuda \
    --env.environment=gr1_microwave \
    --env.embodiment=gr1_pink \
    --env.object=mustard_bottle \
    --env.headless=false \
    --env.enable_cameras=true \
    --env.video=true \
    --env.video_length=10 \
    --env.video_interval=15 \
    --env.state_keys=robot_joint_pos \
    --env.camera_keys=robot_pov_cam_rgb \
    --trust_remote_code=True \
    --eval.batch_size=1

評估 PI0.5

pip install -e ".[pi]"
pip install numpy==1.26.0 # revert numpy to version 1.26
PI0.5 在評估時需要停用 torch 編譯
TORCH_COMPILE_DISABLE=1 TORCHINDUCTOR_DISABLE=1 lerobot-eval \
    --policy.path=nvidia/pi05-arena-gr1-microwave \
    --env.type=isaaclab_arena \
    --env.hub_path=nvidia/isaaclab-arena-envs \
    --rename_map='{"observation.images.robot_pov_cam_rgb": "observation.images.robot_pov_cam"}' \
    --policy.device=cuda \
    --env.environment=gr1_microwave \
    --env.embodiment=gr1_pink \
    --env.object=mustard_bottle \
    --env.headless=false \
    --env.enable_cameras=true \
    --env.video=true \
    --env.video_length=15 \
    --env.video_interval=15 \
    --env.state_keys=robot_joint_pos \
    --env.camera_keys=robot_pov_cam_rgb \
    --trust_remote_code=True \
    --eval.batch_size=1
若要變更平行環境的數量,請使用 ```--eval.batch_size``` 旗標。

預期結果

在評估期間,您將看到一個進度條,顯示執行成功率

Stepping through eval batches:   8%|██████▍    | 4/50 [00:45<08:06, 10.58s/it, running_success_rate=25.0%]

錄影

若要在評估期間啟用錄影功能,請在您的指令中新增以下旗標

--env.video=true \
--env.video_length=15 \
--env.video_interval=15

有關錄影的更多詳細資訊,請參閱IsaacLab 錄影文件

當以 `--env.headless=true` 無頭模式執行時,您還必須為啟用攝影機的環境明確啟用攝影機
--env.headless=true --env.enable_cameras=true

輸出目錄

評估影片會以以下結構儲存到輸出目錄

outputs/eval/<date>/<timestamp>_<env>_<policy>/videos/<task>_<env_id>/eval_episode_<n>.mp4

例如:

outputs/eval/2026-01-02/14-38-01_isaaclab_arena_smolvla/videos/gr1_microwave_0/eval_episode_0.mp4

訓練策略

欲了解更多關於使用 LeRobot 訓練策略的資訊,請參閱訓練文件

IsaacLab Arena 範例資料集可在 HuggingFace Hub 上用於實驗

資料集 說明 影格數
Arena-GR1-Manipulation-Task GR1 微波爐操縱 ~4K
Arena-G1-Loco-Manipulation-Task G1 移動式操縱 ~4K

環境配置

完整配置選項

from lerobot.envs.configs import IsaaclabArenaEnv

config = IsaaclabArenaEnv(
    # Environment selection
    environment="gr1_microwave",      # Task environment
    embodiment="gr1_pink",            # Robot embodiment
    object="power_drill",             # Object to manipulate

    # Simulation settings
    episode_length=300,               # Max steps per episode
    headless=True,                    # Run without GUI
    device="cuda:0",                  # GPU device
    seed=42,                          # Random seed

    # Observation configuration
    state_keys="robot_joint_pos",     # State observation keys (comma-separated)
    camera_keys="robot_pov_cam_rgb",  # Camera observation keys (comma-separated)
    state_dim=54,                     # Expected state dimension
    action_dim=36,                    # Expected action dimension
    camera_height=512,                # Camera image height
    camera_width=512,                 # Camera image width
    enable_cameras=True,              # Enable camera observations

    # Video recording
    video=False,                      # Enable video recording
    video_length=100,                 # Frames per video
    video_interval=200,               # Steps between recordings

    # Advanced
    mimic=False,                      # Enable mimic mode
    teleop_device=None,               # Teleoperation device
    disable_fabric=False,             # Disable fabric optimization
    enable_pinocchio=True,            # Enable Pinocchio for IK
)

直接使用環境中心進行進階操作

建立一個名為 `test_env_load_arena.py` 的檔案,或從EnvHub 下載

import logging
from dataclasses import asdict
from pprint import pformat
import torch
import tqdm
from lerobot.configs import parser
from lerobot.configs.eval import EvalPipelineConfig


@parser.wrap()
def main(cfg: EvalPipelineConfig):
    """Run random action rollout for IsaacLab Arena environment."""
    logging.info(pformat(asdict(cfg)))

    from lerobot.envs.factory import make_env

    env_dict = make_env(
        cfg.env,
        n_envs=cfg.env.num_envs,
        trust_remote_code=True,
    )
    env = next(iter(env_dict.values()))[0]
    env.reset()
    for _ in tqdm.tqdm(range(cfg.env.episode_length)):
        with torch.inference_mode():
            actions = env.action_space.sample()
            obs, rewards, terminated, truncated, info = env.step(actions)
            if terminated.any() or truncated.any():
                obs, info = env.reset()
    env.close()


if __name__ == "__main__":
    main()

執行方式:

python test_env_load_arena.py \
    --env.environment=g1_locomanip_pnp \
    --env.embodiment=gr1_pink \
    --env.object=cracker_box \
    --env.num_envs=4 \
    --env.enable_cameras=true \
    --env.seed=1000 \
    --env.video=true \
    --env.video_length=10 \
    --env.video_interval=15 \
    --env.headless=false \
    --env.hub_path=nvidia/isaaclab-arena-envs \
    --env.type=isaaclab_arena

建立新環境

首先,請依照IsaacLab Arena 文件建立一個新的 IsaacLab Arena 環境。

複製我們的 EnvHub 儲存庫

git clone https://huggingface.co/nvidia/isaaclab-arena-envs

根據您的新環境修改 `example_envs.yaml` 檔案。將您修改後的儲存庫上傳到 HuggingFace EnvHub。

您的 IsaacLab Arena 環境程式碼必須在評估期間於本機上可用。使用者可以單獨複製您的環境儲存庫,或者您可以將環境程式碼和資產直接打包到您的 EnvHub 儲存庫中。

然後,在評估時使用您的新環境

lerobot-eval \
    --env.hub_path=<your-env-hub-path>/isaaclab-arena-envs \
    --env.environment=<your new environment> \
    ...other flags...

我們期待您的貢獻!

疑難排解

CUDA 記憶體不足

減少 `batch_size` 或使用具有更多視訊記憶體 (VRAM) 的 GPU

--eval.batch_size=1

終端使用者授權協議未接受

執行前請設定環境變數

export ACCEPT_EULA=Y
export PRIVACY_CONSENT=Y

錄影功能無法運作

在無頭模式下執行時啟用攝影機

--env.video=true --env.enable_cameras=true --env.headless=true

策略輸出維度不匹配

確保 `action_dim` 與您的策略匹配

--env.action_dim=36

Isaac Sim 初始化期間發生 libGLU.so.1 錯誤

請確保您已安裝以下依賴項,這在無頭機器上很可能會發生。

sudo apt update && sudo apt install -y libglu1-mesa libxt6

參見

Lightwheel LW-BenchHub

Lightwheel 將包含 268 個任務的 `Lightwheel-Libero-Tasks` 和 `Lightwheel-RoboCasa-Tasks` 引入 LeRobot 生態系統。LW-BenchHub 透過遠端操作收集並生成符合 LeRobot 規範的大規模資料集,實現開箱即用的訓練和評估工作流程。藉由 EnvHub 提供的統一介面,開發者可以快速建構端到端實驗管線。

安裝

假設您已遵循安裝步驟,您可以使用以下指令安裝 LW-BenchHub:

conda install pinocchio -c conda-forge -y
pip install numpy==1.26.0 # revert numpy to version 1.26

sudo apt-get install git-lfs && git lfs install

git clone https://github.com/LightwheelAI/lw_benchhub
git lfs pull # Ensure LFS files (e.g., .usd assets) are downloaded

cd lw_benchhub
pip install -e .

如需更詳細的說明,請參閱LW-BenchHub 文件

Lightwheel 任務資料集

LW-BenchHub 資料集可在 HuggingFace Hub 上取得

資料集 說明 任務 (Tasks) 影格數
Lightwheel-Tasks-X7S X7S LIBERO 和 RoboCasa 117 約 10.3M
Lightwheel-Tasks-Double-Piper Double-Piper LIBERO 130 約 6.0M
Lightwheel-Tasks-G1-Controller G1-Controller LIBERO 62 約 2.7M
Lightwheel-Tasks-G1-WBC G1-WBC RoboCasa 32 約 1.5M

有關訓練策略,請參閱訓練策略部分。

評估策略

預訓練策略

以下是可用的已訓練策略

政策 架構 任務 佈局 機器人 連結
smolvla-double-piper-pnp SmolVLA L90K1PutTheBlackBowlOnThePlate libero-1-1 DoublePiper-Abs HuggingFace

評估 SmolVLA

lerobot-eval \
  --policy.path=LightwheelAI/smolvla-double-piper-pnp \
  --env.type=isaaclab_arena \
  --rename_map='{"observation.images.left_hand_camera_rgb": "observation.images.left_hand", "observation.images.right_hand_camera_rgb": "observation.images.right_hand", "observation.images.first_person_camera_rgb": "observation.images.first_person"}' \
  --env.hub_path=LightwheelAI/lw_benchhub_env \
  --env.kwargs='{"config_path": "configs/envhub/example.yml"}' \
  --trust_remote_code=true \
  --env.state_keys=joint_pos \
  --env.action_dim=12 \
  --env.camera_keys=left_hand_camera_rgb,right_hand_camera_rgb,first_person_camera_rgb \
  --policy.device=cuda \
  --eval.batch_size=10 \
  --eval.n_episodes=100

環境配置

透過修改配置檔案中的 `robot`、`task` 和 `layout` 設定,可以快速啟動評估。

完整配置選項

# =========================
# Basic Settings
# =========================
disable_fabric: false
device: cuda:0
sensitivity: 1.0
step_hz: 50
enable_cameras: true
execute_mode: eval
episode_length_s: 20.0 # Episode length in seconds, increase if episodes timeout during eval

# =========================
# Robot Settings
# =========================
robot: DoublePiper-Abs # Robot type, DoublePiper-Abs, X7S-Abs, G1-Controller or G1-Controller-DecoupledWBC
robot_scale: 1.0

# =========================
# Task & Scene Settings
# =========================
task: L90K1PutTheBlackBowlOnThePlate # Task name
scene_backend: robocasa
task_backend: robocasa
debug_assets: null
layout: libero-1-1 # Layout and style ID
sources:
  - objaverse
  - lightwheel
  - aigen_objs
object_projects: []
usd_simplify: false
seed: 42

# =========================
# Object Placement Retry Settings
# =========================
max_scene_retry: 4
max_object_placement_retry: 3

resample_objects_placement_on_reset: true
resample_robot_placement_on_reset: true

# =========================
# Replay Configuration Settings
# =========================
replay_cfgs:
  add_camera_to_observation: true
  render_resolution: [640, 480]

參見

在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.