-
Notifications
You must be signed in to change notification settings - Fork 3.4k
NVIDIA IsaacLab-Arena Lerobot #2699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
NVIDIA IsaacLab-Arena Lerobot #2699
Conversation
This reverts commit 9b445356385d0707655cf04d02be058b25138119.
…licy evaluation at scale
Integrate NVIDIA IsaacLab Arena with LeRobot to enable GPU-accelerated
simulation through the EnvHub infrastructure.
This enables:
- Training imitation learning policies (PI0, SmolVLA, etc.)
- Evaluating trained policies in with IsaacLab Arena
The implementation adds:
- IsaaclabArenaEnv config with Arena-specific parameters
- IsaaclabArenaProcessorStep for observation processing
- Hub loading from nvkartik/isaaclab-arena-envs repository
- Video recording support
Available environments include GR1 microwave manipulation, Galileo
pick-and-place, G1 loco-manipulation, and button pressing tasks.
Datasets: nvkartik/Arena-GR1-Manipulation-Task
Policies: nvkartik/pi05-arena-gr1-microwave,
nvkartik/smolvla-arena-gr1-microwave
|
@imstevenpmwork - For the installation phase - we will try to simplify the process as possible - and include it in the documentation page [to be written] - it will be similar to how it is done for our gr00t implementation. |
| # Handle IsaacLab Arena format: observations have 'policy' and 'camera_obs' keys | ||
| if "policy" in observations: | ||
| return_observations[f"{OBS_STR}.policy"] = observations["policy"] | ||
|
|
||
| if "camera_obs" in observations: | ||
| return_observations[f"{OBS_STR}.camera_obs"] = observations["camera_obs"] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be unecesary.
If "policy" represents the robot state, you can change the IsaaclabArenaProcessorStep to conform to the accepted namings of preprocess_observation which include agent_pos or robot_state.
Same thing for camera_obs. Our naming convenion is OBS_IMAGES.{camera_name} not "{OBS_STR}.camera_obs" for visual observations.
I also see you're already renaming correclty in the env processor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jadechoghari : is there a plan to complete this todo as mentioned, this would give flexibility to use custom names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aliberts : it would be great to remove the hardcoded features.
|
|
||
| key: str = "a" | ||
| value: PolicyFeature = PolicyFeature(type=FeatureType.STATE, shape=(1,)) | ||
| value: PolicyFeature = field(default_factory=lambda: PolicyFeature(type=FeatureType.STATE, shape=(1,))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this change necessary?
src/lerobot/scripts/lerobot_eval.py
Outdated
| elif hasattr(env, "render_all"): | ||
| # IsaacLabVectorEnvWrapper uses render_all() method for video recording | ||
| ep_frames.append(np.stack(env.render_all()[:n_to_render_now])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instead introduce a small env.render wrapper for the env? instead of adding a special case branch here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, added IsaacLab wrapper based on AsyncVectorEnv, thus removing this code.
| hub_repo_id: str = "nvkartik/isaaclab-arena-envs" | ||
| episode_length: int = 300 | ||
| num_envs: int = 1 | ||
| embodiment: str | None = "gr1_pink" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can i switch embodiments in each tasks?. For instance in task A, can i select robot A or robot B
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
| cd .. | ||
|
|
||
| # 6. Install additional dependencies | ||
| pip install qpsolvers==4.8.1 numpy==1.26.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this version of numpy break compatibailtiy with the current numpy version in LeRobot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not ideal, but so far our tests didn't exhibited any breaking.
We can include a note recommending the developer to create a dedicated conda env for evaluation using this feature, and other conda env for training, in case they encounter any numpy-related warnings
|
|
||
| - NVIDIA GPU with CUDA support | ||
| - NVIDIA driver compatible with IsaacSim 5.1.0 | ||
| - Linux (Ubuntu 22.04 recommended) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i don't have a nvidia gpu, i won't be able to run isaac arena?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isaac Lab requires NVIDIA GPU - if one does not have one handy we usually point them to Brev
src/lerobot/envs/factory.py
Outdated
| elif "isaaclab_arena" in cfg.type: | ||
| # Load IsaacLab Arena environment from the Hub | ||
| repo_id, file_path, local_file, revision = _download_hub_file( | ||
| cfg.hub_repo_id, trust_remote_code=True, hub_cache_dir=hub_cache_dir | ||
| ) | ||
| module = _import_hub_module(local_file, repo_id) | ||
| raw_result = _call_make_env( | ||
| module, n_envs=cfg.num_envs, use_async_envs=use_async_envs, **cfg.hub_kwargs, **kwargs | ||
| ) | ||
|
|
||
| return _normalize_hub_result(raw_result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this what this conditioning branch (envhub) already does?
lerobot/src/lerobot/envs/factory.py
Line 115 in b2ef6ae
| if isinstance(cfg, str): |
So we can just pass the hub string instead, no?
nvkartik/isaaclab-arena-envs
src/lerobot/envs/utils.py
Outdated
|
|
||
|
|
||
| def _call_make_env(module: Any, n_envs: int, use_async_envs: bool) -> Any: | ||
| def _call_make_env(module: Any, n_envs: int, use_async_envs: bool, **kwargs: Any) -> Any: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, we will merge this PR soon: https://github.com/huggingface/lerobot/pull/2599/files for the custom kwargs if it works for you
Feat/e2e hub support
Type / Scope
Summary / Motivation
This PR introduces NVIDIA IsaacLab-Arena integration into LeRobot, enabling GPU-accelerated simulation environments through the EnvHub infrastructure. IsaacLab-Arena provides high-fidelity physics simulation for large-scale policy evaluation for various tasks. The community is encouraged to create custom environments using the IsaacLab-Arena framework.
The integration allows developers to:
This implementation follows the EnvHub pattern, loading environments from the Hub repository
nvkartik/isaaclab-arena-envswhile providing a native environment configuration (IsaaclabArenaEnv) for seamless CLI integration.Available Environments
The following are example environments built with NVIDIA IsaacLab-Arena:
gr1_microwavegalileo_pnpg1_locomanip_pnpkitchen_pnppress_buttonThis is just the start, more examples coming soon! 🚀
What Changed
New Files
tests/processor/test_arena_processor.pyModified Files
src/lerobot/envs/configs.pyIsaaclabArenaEnvconfiguration dataclass with IsaacLab-Arena-specific parameters (embodiment, object, environment, camera/state keys)src/lerobot/envs/factory.pyIsaaclabArenaProcessorStepcreationsrc/lerobot/envs/utils.pypreprocess_observation()to handle IsaacLab-Arena's observation format (policy,camera_obs)src/lerobot/processor/env_processor.pyIsaaclabArenaProcessorStepfor processing IsaacLab-Arena observations (state concatenation, image normalization/permutation)src/lerobot/scripts/lerobot_eval.pyrender_all()support for IsaacLab wrapper video recordingtests/processor/test_pipeline.pyKey Implementation Details
Environment Configuration (
IsaaclabArenaEnv):Observation Processor (
IsaaclabArenaProcessorStep):obs["policy"]based on configurablestate_keysobs["camera_obs"]based oncamera_keysobservation.statevectorBreaking Changes: None
How Was This Tested
Automated Tests
Test coverage includes:
Manual Verification
Zero-agent environment test:
python test_env_load_arena.py \ --env.type=isaaclab_arena \ --env.environment=galileo_pnp \ --env.embodiment=gr1_pink \ --env.object=cracker_box \ --env.num_envs=4 \ --env.enable_cameras=true \ --env.seed=1000Policy evaluation (SmolVLA):
lerobot-eval \ --policy.path=nvkartik/smolvla-arena-gr1-microwave \ --env.type=isaaclab_arena \ --rename_map='{"observation.images.robot_pov_cam_rgb": "observation.images.robot_pov_cam"}' \ --env.environment=gr1_microwave \ --env.embodiment=gr1_pink \ --env.num_envs=1 \ --env.headless=true \ --policy.device=cuda \ --env.enable_cameras=true \ --env.video=truePolicy evaluation (PI0.5):
TORCH_COMPILE_DISABLE=1 TORCHINDUCTOR_DISABLE=1 lerobot-eval \ --policy.path=nvkartik/pi05-arena-gr1-microwave \ --env.type=isaaclab_arena \ --rename_map='{"observation.images.robot_pov_cam_rgb": "observation.images.robot_pov_cam"}' \ --env.environment=gr1_microwave \ --env.embodiment=gr1_pink \ --env.num_envs=1 \ --env.headless=true \ --policy.device=cuda \ --env.enable_cameras=trueTraining (PI0.5):
lerobot-train \ --policy.type=pi05 \ --dataset.repo_id nvkartik/Arena-GR1-Manipulation-Task \ --rename_map '{"observation.images.robot_pov_cam":"observation.images.camera1"}' \ --policy.empty_cameras=2 \ --policy.max_state_dim=64 \ --policy.max_action_dim=64 \ --batch_size=16 \ --steps=20000How to Run Locally (Reviewer)
1. Install Dependencies
2. Run Tests
3. Run Environment Smoke Test
Checklist (Required Before Merge)
pre-commit run -a)pytest tests/processor/test_arena_processor.py)Reviewer Notes
Focus Areas
IsaaclabArenaProcessorStep(src/lerobot/processor/env_processor.py): Core observation processing logic - verify state concatenation ordering and image normalizationIsaaclabArenaEnvconfig (src/lerobot/envs/configs.py): Validate Hub kwargs mapping and feature definitionssrc/lerobot/envs/factory.py): Ensure proper Hub loading and processor instantiationAvailable Resources
Datasets:
Trained Policies:
Environment Repository:
Notes for Community Reviewers
export ACCEPT_EULA=Y)