Skip to content

Add GR00T Training Examples: Pick and place apple and pack AGX orin - #7776

Merged
ooctipus merged 46 commits into
isaac-sim:mainfrom
Fanxing-LI:fansing/rlinf_VLA
Nov 21, 2026
Merged

ooctipus merged 46 commits into
isaac-sim:mainfrom
Fanxing-LI:fansing/rlinf_VLA

Conversation

@Fanxing-LI

@Fanxing-LI Fanxing-LI commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds GR00T post-training examples for two Unitree H2 + Sharpa tasks, with training and evaluation configurations:

  • IsaacContrib-Pick-And-Place-Apple-H2-Sharpa
  • IsaacContrib-Pack-AGX-Orin-H2-Sharpa

The policy sends 58 absolute position targets in dataset order. The existing Newton joint impedance controller tracks the 14 arm joints with the H2 gains and gravity feed-forward on PhysX. The 44 hand joints use the standard joint-position action. Both tasks share the starting pose and wrist calibration. Camera terms read raw RGB through the core observation manager and apply the fitted task-specific response. Scene selectors resolve wrist and thumb indices for each task’s success term.

Both task packages register their environment in __init__.py, define it in <task>_env_cfg.py, and keep their RLinf recipe in agents/. For --config_name, use rlinf_gr00t_pick_and_place_apple_ppo_cfg or rlinf_gr00t_pack_agx_ppo_cfg.

Validation

  • Built the aggregate Isaac Lab release wheel and verified it contains both H2 PPO recipes and their MDP stubs. The four Gym IDs in the packaged recipes resolve to the intended environment configurations.
  • All four train and evaluation registrations validated and serialized. The six camera configurations produced byte-identical calibration results across all 256 input levels against the original transform.
  • Focused Newton controller, joint action, Pink and RLinf wrapper checks passed during development. Repository formatting, lint and changelog checks passed.
  • Both tasks ran 12 scripted policy steps (48 physics steps each) in headless Isaac Sim with the original scene assets and three 320 × 240 RGB streams. With identical starting positions and commands, the peak arm position difference from the previous PR head was 0.0172 rad and the peak applied torque difference was 3.58 N·m. Newton reads joint feedback each physics step. Refreshing the previous controller’s inputs at the same point reduced the peak arm torque difference to 0.000007 N·m on the Apple replay.
  • A saturation test in the Apple scene hit the same per-joint torque limits (125, 154 and 220 N·m) on all 14 arm joints in both revisions.
  • PhysX reported the existing Table256 static-body fixed-joint error in both revisions.

Trained-policy playback

The RLinf env worker supplies action chunks on the CPU. When holding reset poses, the wrapper now moves each chunk to the simulator’s device before using its reset mask. Both H2 evaluation commands previously failed on the second action with a CPU/CUDA mismatch. The regression test reproduces the failure on the previous revision and passes with the fix.

The following runs used headless Isaac Sim on PhysX, RLinf video recording, the pinned GR00T N1.7 stack and Cosmos-Reason2-2B. Each task used one rollout epoch with the evaluation environment seed set to 0.

  • Apple completed the handover, placement and release. RLinf reported one success in one trajectory, 352 steps and a return of 4. Apple checkpoint, step 200
  • Pack AGX lifted and aligned the unit in the single-environment run and timed out at 448 steps with a return of 2. The previous arm controller gave the same result with the device fix applied. A separate four-environment run recorded 0/4 successes with Newton joint impedance and 0/4 with the previous controller. Mean returns in that batch were 1.5 with Newton and 2.0 with the previous controller. Both used RTX 5090 GPUs. AGX checkpoint, step 800

Reference recordings

These recordings were supplied with the original implementation, not regenerated after the cleanup.

Apple AGX Orin
pick_and_place_apple_third_person.mp4
pack_agx_orin_third_person.mp4

Release backport

  • Backport this pull request to the active release branch after it merges into develop

@Fanxing-LI
Fanxing-LI requested a review from a team September 13, 2026 04:31
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Sep 13, 2026
@greptile-apps

greptile-apps Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR is not yet safe to merge because the new N1.7 train and playback paths can fail to locate their required Cosmos backbone in Ray workers.

Findings

  1. P1 Backbone Path Remains Relative ▶
  2. P2 Tokenizers Pin Is Unchecked ▶

Summary

  • Adds pick-and-place-apple and Pack AGX Orin training/evaluation environments with staged rewards and reference configurations.
  • Extends the RLinf bridge for N1.7 modality registration and H2 action ordering.
  • Adds checkpoint playback/resume handling and an installer for generation-specific packages, GR00T sources, and checkpoints.
  • One worker-path omission can prevent the required N1.7 backbone from loading; the installer also does not fully validate its generation-specific package pins.

Diagram

sequenceDiagram
    participant CLI as Isaac Lab CLI
    participant Config as Hydra task config
    participant Ray as RLinf Ray worker
    participant Loader as GR00T N1.7 loader
    participant Env as H2 Isaac Lab environment

    CLI->>Config: Load actor/rollout and task settings
    CLI->>Config: Absolutize model_path
    Note over CLI,Config: backbone_model_path remains relative
    Config->>Ray: Launch worker with resolved configuration
    Ray->>Loader: Build N1.7 model and load Cosmos backbone
    Loader-->>Ray: Backbone lookup depends on worker cwd
    Ray->>Env: Register modality mapping and create task
    Env->>Env: Reset and step once to refresh cameras
    Ray->>Env: Execute action chunks
    Env-->>Ray: Observations, rewards, and terminations
Loading

Reviews (1) · Last reviewed commit: "Share one asset root across the RLinf ta..."

Comment on lines +162 to +163
for model_cfg in (cfg.actor.model, cfg.rollout.model):
model_cfg.model_path = str(Path(model_cfg.model_path).expanduser().resolve())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Backbone path remains relative

The new N1.7 configurations require a local backbone_model_path, but this loop only makes model_path absolute. If RLinf's native N1.7 loader resolves the backbone path in the Ray worker, it looks for .pretrained_checkpoints/rlinf/Cosmos-Reason2-2B relative to the worker's different working directory and can fail to load the model. Resolve backbone_model_path for both actor and rollout configurations here and in the equivalent loop in play_rlinf.py.

Comment on lines +159 to +164
satisfied = (
installed_version("rlinf") == RLINF_VERSION and installed_version("transformers") == profile.transformers
)
if not force and satisfied:
print_info(f"rlinf=={RLINF_VERSION} and transformers=={profile.transformers} are already installed.")
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Tokenizers pin is unchecked

The installer treats the profile as satisfied without checking its generation-specific tokenizers requirement. If a partial installation or later package operation leaves RLinf and Transformers at the requested versions but removes or changes Tokenizers, rerunning this advertised repairable installer skips the corrective installation and leaves GR00T with an incompatible environment. Include the installed Tokenizers version and the profile's required range in this check.

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isaac Lab Review Bot

The GR00T N1.7 integration has two material integration gaps: the new relative backbone path is not normalized before reaching Ray workers, and the existing assemble-trocar task is moved from a versioned NVIDIA asset bundle to an unpinned personal Hugging Face repository. Evaluation logging also reports the obsolete checkpoint field, and shared H2 action logic is duplicated across both tasks.

  • Design and architecture: The shared H2 + Sharpa package is the appropriate ownership boundary, but both task packages retain byte-identical gravity-compensated action implementations that should live in that shared module. Repointing an existing task from its versioned NVIDIA bundle to a temporary personal asset host also weakens the task's availability and reproducibility contract.
  • API: Checkpoint and resume resolution support the intended path forms, but the evaluation banner still reads runner.eval_policy_path after checkpoint loading moved to runner.ckpt_path or model rl_model_path, so runs supplied with --checkpoint are reported as using no checkpoint. The assemble-trocar asset source change also alters an existing environment's external compatibility surface without a stable replacement host.
  • Implementation: Both entrypoints convert model_path to an absolute path for Ray workers but leave the new relative backbone_model_path unchanged, so N1.7 workers can resolve the Cosmos backbone against the wrong working directory. Normalize that field in train and play as well. Consolidate the duplicated H2 gravity-compensated action term in the shared embodiment module and update the checkpoint banner to report the path actually consumed.

Significant concerns. Posted 4 actionable findings inline.

Automated review; human maintainers own approval decisions.

# Ray workers do not inherit the launcher's working directory, so a relative
# checkpoint path from the YAML must be made absolute before it reaches them.
for model_cfg in (cfg.actor.model, cfg.rollout.model):
model_cfg.model_path = str(Path(model_cfg.model_path).expanduser().resolve())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Warning · Implementation — backbone_model_path stays relative for Ray workers

This loop (and the identical one in play_rlinf.py) absolutizes only model_path, but both new N1.7 configs also set a relative backbone_model_path: ".pretrained_checkpoints/rlinf/Cosmos-Reason2-2B", annotated as needing a local directory for offline load. By the same reasoning stated in the added comment, workers resolve it against their own working directory and can fail to find the backbone. Normalize backbone_model_path when present in both entrypoints.

@@ -77,8 +77,9 @@
"right_elbow_joint": -0.3,
}

HEALTHCARE_S3 = "https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/Healthcare/0.5.0/132c82d"
USD_ROOT = f"{HEALTHCARE_S3}/Props/LightWheel"
from isaaclab_tasks.contrib.rlinf_assets import PROP_ASSET_ROOT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Warning · Design Architecture — Existing task repointed to personal asset host

USD_ROOT for the already-shipping IsaacContrib-Assemble-Trocar-G129-Dex3 moves from the versioned NVIDIA Omniverse bundle to RLINF_DEMO_ASSET_ROOT, which defaults to a personal Hugging Face account with no pinned revision. A previously stable public environment now breaks if that repository is renamed, gated or reorganized. Keep this task on its published asset-server bundle until the shared tree is hosted officially; also move the new import to module top.

# The RLinf extension overlays these onto the N1.5 model it constructs. Older RLinf
# builds the rollout model from actor.model, newer ones from rollout.model in eval mode.
cfg.actor.model.rl_model_path = rl_weights
cfg.rollout.model.rl_model_path = rl_weights

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Suggestion · Implementation — Startup banner prints unset eval_policy_path

runner.eval_policy_path is no longer assigned, yet the unchanged banner below still prints it and the task YAMLs default it to null. Every evaluation run now logs Checkpoint: None even when --checkpoint resolved weights, so the log no longer shows which weights were loaded. Print the resolved rl_weights (or the field actually consumed) instead.

from isaaclab.envs.mdp.actions.joint_actions import JointPositionAction


class H2GravityCompensatedJointPositionAction(JointPositionAction):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Suggestion · Design Architecture — Embodiment action term duplicated across tasks

H2GravityCompensatedJointPositionAction is byte-identical to the copy in pick_and_place_apple/mdp/actions.py — its docstring still reads "pick-and-place apple task" — and the policy-order observation helpers are duplicated the same way. These are embodiment-level, not task-level, and this PR already adds isaaclab_tasks.contrib.h2_sharpa for exactly that; two copies will drift as the H2 articulation changes.


import gymnasium as gym

for task_id in ("IsaacContrib-Pack-AGX-Orin-H2-Sharpa", "IsaacContrib-Pack-AGX-Orin-H2-Sharpa-Eval"):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

expand this instead of using for loop

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

from ..camera_config import CameraPresets
from ..robot_config import H2RobotPresets

TABLE_USD = f"{PROP_ASSET_ROOT}/Assets/Table256/Table256.usd"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

USD link should be in env_cfg I think

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

logger = logging.getLogger(__name__)


def _preview_material(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lets use the visual material asset cfg in config for this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This material post-modification is added by mingxue. Rather than manually changing the material, it should update the asset primarily. This alignment affects sim2real transfer, but if for demo, we can remove these patches here. I have commented out these lines.

if len(env_ids) == 0:
return

from .rewards import get_pack_agx_state

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lets have import at top instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

return _policy_idx_cache[key]


def get_robot_joint_states(env: ManagerBasedRLEnv) -> torch.Tensor:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it might be easier to use shared mdp for joint pos and joint velocity instead of declare your own

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I put basic h2 sharpa robot into asset/robot/, the head camera into asset/camera/

return torch.cat([joint_pos, joint_vel, joint_torque], dim=-1)


def get_robot_policy_joint_positions(env: ManagerBasedRLEnv) -> torch.Tensor:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you could use joint position and supply the index through scene_entity_cfg instead of creating a new function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

return env.pnp_apple_state


def get_task_stage(env: ManagerBasedRLEnv) -> torch.Tensor:

@ooctipus ooctipus Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

shim function should be avoid as much as possible unless there are difficult reasons

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This function has been removed. now it directly use env.pnp_apple_state.

reward. Release requires the AGX to remain seated, the right thumb to open,
and the right wrist to retreat.
"""
state = get_pack_agx_state(env)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lets try to reduce function that takes in env, they are way to flexible and unstructured

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the function left by Healthcare, I change it into a startup event.

return get_pack_agx_state(env).task_stage


def _position_distance(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the math is simple enough it might be easier to directly look at computation rather than wrapped in function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have removed this func, making lines where use this func directly refers to get_pack_agx_state(env).task_stage.

advance = in_stage & (hold_counter >= hold_steps)
stage = torch.where(advance, torch.full_like(stage, current + 1), stage)
hold_counter = torch.where(advance, torch.zeros_like(hold_counter), hold_counter)
return stage, hold_counter

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we might want to avoid the word stage, beucase stage usually in isaaclab means usd stage, in this case you means phase, you can have a enum of predefined stage constant for better readability

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have replaced all stage with phase.

@github-actions github-actions Bot added asset New asset feature or request infrastructure labels Sep 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think it makes sense to called this as rlinf_assets.py. Rlinf does not provide any asset.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is a temporary file here, after robot and asset has been upload to right position, it will be deleted.

mingxueg-nv and others added 26 commits November 20, 2026 22:27
The scene props the three RLinf post-training tasks draw from the shared bundle are
Lightwheel SimReady assets, distributed under Creative Commons
Attribution-NonCommercial 4.0 International. Neither the attribution nor the licence
terms were recorded anywhere in the repository.

Collect the terms under docs/licenses/assets/, next to the other asset licences, and
state the attribution in both places a reader meets the assets: an "Attribution and
Citation" section in the feature documentation, and a comment on the PROP_ASSET_ROOT
constant the tasks resolve their USDs from. The documentation section also carries the
RLinf citation, the framework the whole feature is built on.

The non-commercial grant is called out under an "attention" admonition rather than
left implicit, because Isaac Lab itself ships under BSD-3-Clause.
Share robot control and camera definitions, use ordered policy actions directly, and keep episode progress in the success term. Reuse RLinf chunk handling and apply material overrides when prototypes are spawned.

Replace the checkout-repair installer with explicit dependency setup. Validate 77 focused tests, four task configurations, and native RLinf chunk-loop equivalence across eight mode combinations. Full scene checks remain blocked by HTTP 401 from the task asset repository.
@ooctipus
ooctipus merged commit 5fc0a6a into isaac-sim:main Nov 21, 2026
62 checks passed
ooctipus pushed a commit that referenced this pull request Nov 26, 2026
…ing guide (#9155)

# Description

Follow-up to #7776. Verifying the RLinf VLA post-training guide end to
end turned up two defects in the `isaaclab_rl` RLinf entry points and
several problems in the guide itself. This PR fixes them and removes the
remaining references to personal Hugging Face checkpoints.

**Entry point fixes (`isaaclab_rl`)**

- `isaaclab play --rl_library rlinf --checkpoint latest|best` never
found a checkpoint. Playback looked up run manifests with
`env.eval.init_params.id`, while training records
`env.train.init_params.id`. All three shipped recipes use a distinct
`...-Eval` id for evaluation, so the lookup always failed with `No
compatible manifested run with a checkpoint was found`. Playback now
resolves the selector against the training id, matching
`train_rlinf.py`; an explicit `--task` still takes precedence.
- A relative `--config_path` failed with `initialize_config_dir()
requires an absolute config_dir as input`. The path is now resolved to
an absolute directory before Hydra is initialized.
- The launch test is now a train → play round trip with a relative
config directory: training writes the run manifest, and playback
resolves `latest` through it although the recipe's eval task id differs
from its training id. Reverting either fix, or making training record
the eval id, turns the test red with the original errors.

**Documentation (`rlinf_vla_posttraining.rst`)**

- Remove the paragraph that pointed at the task author's personal
checkpoint repositories.
- Move the `assemble_trocar` `hf download` from the prerequisites into a
new "Assemble Trocar checkpoint" subsection after the Step 2 dependency
pins, and run it with `uv run --no-sync`. With the lockfile's
`huggingface-hub` 1.x and `typer` 0.27, `hf` downloads the files but
exits non-zero with a `click.exceptions.Exit` traceback; any
`huggingface-hub` < 1.0 works. The Step 2 floor is raised to `>=0.34`,
the first release that ships the `hf` CLI.
- Add `Environments/Grid` to the local-mirror subtree list; the default
`GroundPlaneCfg` USD is loaded from there.
- Mark flash-attn as optional for GR00T N1.7, which falls back to
PyTorch SDPA attention with a warning when the package is missing
(building it needs a CUDA 13 `nvcc` to match the lockfile's torch).
- Add `--no-sync` to the `uv run isaaclab ...` commands in "Key Files"
so they do not re-sync the environment.

No linked issue.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- Documentation update

## Screenshots

Not applicable (CLI and documentation changes).

## Validation

- `uv run python -m pytest source/isaaclab_rl/test/test_entrypoints.py`
passes (the one skrl parser test was deselected locally because `skrl`
is not installed in my environment).
- Mutation checks: reverting the playback fix fails the new test with
the manifest `ValueError`; reverting the config-path fix fails it with
the Hydra `initialize_config_dir()` error; making training record the
eval id fails it with the manifest `ValueError`.
- `pre-commit` on the changed files, the changelog gate
(`tools/changelog/cli.py check`), and a Sphinx render of the guide pass.
- No GPU training or evaluation runs were performed for this PR; the
code changes are confined to CLI argument handling.

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then comment `run-ci` on the pull request, or `run-ci ovstage` to
include kitless OVStage rendering tests for that run. Subsequent pushes
and plain `run-ci` comments do not run OVStage tests unless you comment
`run-ci ovstage` again.

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/HEAD/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

asset New asset feature or request documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants