Repository navigation
[6Bii] Load G1 SDG configuration before runtime launch - #8475
Conversation
|
run-ci |
|
| cfg = parse_env_cfg("Isaac-G1-SteeringWheel-Locomanipulation", device="cpu", num_envs=1) | ||
| assert cfg.scene.num_envs == 1 | ||
| assert cfg.sim.device == "cpu" | ||
| assert cfg.actions.upper_body_ik.controller.urdf_path.endswith(".urdf") |
There was a problem hiding this comment.
The new test checks only that urdf_path ends in .urdf. A downloaded local path can pass too, so this assertion does not protect the change that keeps URDF retrieval out of configuration loading. Assert that the path still equals the remote asset URL, or make retrieve_file_path raise if called while loading the configuration.
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Style consistency (2), Test quality (1). Other reviewed categories look good.
- PR description: The body matches the diff; replace volatile line counts and identify the command used for the 15 launcher tests to keep validation reproducible.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Implementation looks good.
- Style consistency: The rollout script retains the obsolete launch-order explanation, and the moved configuration comment inaccurately describes the deferred URDF assignment; update both comments.
- Test quality: The added subprocess test covers pre-launch configuration loading, but its
.urdfsuffix assertion passes before the retrieval change; assert the unresolved nucleus URL.
Minor fixes needed. Posted 3 inline findings.
Automated review; human maintainers own approval decisions.
| if env_name is None: | ||
| raise ValueError("Task/env name was not specified nor found in the dataset.") | ||
| env_cfg = parse_env_cfg(env_name, device=args_cli.device, num_envs=1, overrides=hydra_overrides) | ||
| with torch.no_grad(), launch_simulation(env_cfg, args_cli): |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Stale launch-order comment not updated
Configuration now parses before launch_simulation, but line 38's comment still states the Kit runtime launches first because the task config imports USD. Update it as generate_data.py line 132 was.
| self.sim.render_interval = 6 | ||
| self.sim.default_visualizer_cfg = VisualizerCfg(eye=(0.0, 3.0, 1.25), lookat=(0.0, 0.0, 0.5)) | ||
|
|
||
| # Set the URDF and mesh paths for the IK controller |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — URDF resolution split left undocumented
The comment still says "URDF and mesh paths" while the field now holds an unresolved nucleus URL that G1LocomanipulationSDGEnv.__init__ retrieves. State the deferred resolution here or at the constructor.
| cfg = parse_env_cfg("Isaac-G1-SteeringWheel-Locomanipulation", device="cpu", num_envs=1) | ||
| assert cfg.scene.num_envs == 1 | ||
| assert cfg.sim.device == "cpu" | ||
| assert cfg.actions.upper_body_ik.controller.urdf_path.endswith(".urdf") |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Assertion passes without the fix
Both the previously retrieved local path and the new nucleus URL end in ".urdf", so this cannot detect retrieval at config time. Assert the unresolved nucleus URL instead.
## Description Simplify task preset traversal and replace the custom CLI argument scanner, help builder, and formatter with argparse. This includes observable changes to help, error output, and configuration traversal; the examples below show those changes. Preset parsing, categories, and traversal now live together in `isaaclab_tasks.utils.hydra`; `preset_cli.py` and `preset_target.py` are removed. Preset handling stays in `isaaclab_tasks`. Runtime launch and visualizer selection changes are in #8126; the independent SDG fix is #8475. **22 files; +354 / −894 lines (540 fewer overall).** ## Before and after ### Unknown preset: same rejection, different error output ```bash uv run isaaclab train --task Isaac-Cartpole-Direct --rl_library rsl_rl presets=typo ``` Before, the error grouped names by their affected paths: ```text ValueError: Unknown preset(s): typo Available presets (grouped by affected paths): isaacsim_physx, newton_kamino, newton_mjwarp, ovphysx, physx -> env.sim.physics ``` After, it lists each configuration path and its choices directly, in declaration order: ```text ValueError: Unknown preset(s): typo Available presets by config path: env.sim.physics: isaacsim_physx, ovphysx, physx, newton_mjwarp, newton_kamino ``` The command still fails before simulation launch. Typed-selector errors are also shorter. For example: ```bash uv run isaaclab train --task Isaac-Cartpole-Camera-Direct --rl_library rsl_rl physics=rgb ``` Both revisions reject `physics=rgb` because RGB is not a physics preset. After this change, the error retains `Typed preset selector(s) physics=rgb did not match any preset of that type for this task.` and removes the following explanation/suggested fixes. ### Help invoked with an explicit argument list now uses that list ```bash uv run python -c 'from isaaclab.cli import train; train(["--task", "Isaac-Cartpole-Direct", "--rl_library", "rsl_rl", "--help"])' ``` - **Before:** help looked at process-wide `sys.argv` for the task, so it printed `Pass --task=X along with --help to see preset variants available for that task`, despite the task being supplied to `train()`. - **After:** help reads the supplied arguments and lists `isaacsim_physx`, `newton_kamino`, `newton_mjwarp`, `ovphysx`, and `physx` under `physics=NAME`. The ordinary `uv run isaaclab train --task Isaac-Cartpole-Direct --rl_library rsl_rl --help` command lists those choices in both revisions. Help formatting now uses argparse's `RawDescriptionHelpFormatter`. ### Python configuration traversal changes These affect callers constructing configurations in Python: ```python from types import SimpleNamespace from isaaclab_tasks.utils.hydra import collect_presets, preset, resolve_presets choice = preset(default=1, fast=2) a = resolve_presets({"items": (choice,)}, ["fast"])["items"][0] b = resolve_presets(SimpleNamespace(mode=choice), ["fast"]).mode class Custom: mode = choice c = list(collect_presets(Custom())) d = list(collect_presets(preset(default={"nested": choice}))) ``` | Result | Before | After | |---|---|---| | `a`: preset inside a tuple | Unresolved `PresetCfg` | `2` | | `b`: preset inside a namespace | Unresolved `PresetCfg` | `2` | | `c`: discovery on an arbitrary custom object | `["mode"]` | `[]` | | `d`: paths inside a dictionary-valued alternative | `[""]` — the nested key was lost | `["", "nested"]` | **Custom-configuration compatibility:** traversal now uses config/dataclass instance fields, namespaces, mappings, lists, and tuples. It no longer inspects arbitrary object properties or class attributes with `dir()`/`getattr()`. Callers relying on that discovery must use `@configclass` fields or one of the supported containers. ### Direct imports Replace `isaaclab_tasks.utils.preset_cli` and `isaaclab_tasks.utils.preset_target` imports with `isaaclab_tasks.utils.hydra`. The package-level `from isaaclab_tasks.utils import setup_preset_cli` remains unchanged. This consolidation preserves selection and help behavior and fixes the environment documentation tool's stale alias lookup. ## Validation - Verified the CLI/error and Python examples above against the previous implementation (`e21e2515`) and the pre-rebase implementation (`d00bbe09d`). - After rebasing onto develop `3c02cf760`, 159 focused tests passed across preset composition/help, Franka presets, checkpoint tooling, task discovery, and environment documentation. The existing help test also guards against reintroducing the two removed modules. - Formatting/lint and changelog checks passed; the Sphinx build passed with warnings treated as errors. - The CI case that previously exited with code 139, `test_visualizer_golden[newton-cartpole-kit-tiled]`, passed locally on GPU0 in 28 seconds. The complete Newton golden-image file finished with 9 passes and 3 image mismatches; all 3 mismatches also reproduced on unmodified develop with effectively identical image scores. No skips, thresholds, or retries were changed. - [Fresh CI](https://github.com/isaac-sim/IsaacLab/actions/runs/38312378346) is running for `80aa4326b`; the earlier native CI crash has not been reproduced locally or established as fixed. ## Type of change - Refactoring with CLI help/error and configuration traversal changes - Compatibility change for custom objects relying on implicit attribute discovery ## Release backport - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [x] Read the contribution guidelines - [x] Ran formatting/lint and changelog checks - [x] Updated and built documentation - [x] Validated focused coverage and reviewed consolidated tests - [x] Added package changelog fragments - [x] Contributor already listed - [ ] Full CI
e77b901 to
cc8e9a9
Compare
|
run-ci |
|
run-ci |
Description
Merely loading the G1 synthetic-data-generation (SDG) configuration performed work that belongs to the running environment:
__post_init__retrieved the IK URDF, potentially downloading it just to inspect or override settings. The Pink IK controller already supports retrieving that asset when it initializes.scanagain.This PR moves the existing config classes into
g1_locomanipulation_sdg_env_cfg.pyand points the task registry there. Config loading now keeps the URDF URL without importing the environment or retrieving the asset. The existing IK controller owns retrieval; no extra retrieval step is added to the environment.Both scripts now parse configuration first and pass it directly to
launch_simulation, removing the post-launch scan. CLI arguments and environment settings are unchanged. Existing config imports from the runtime module and GR00T's remote-policy mode remain available.7 files; +226 / −189 lines, mostly moving existing configuration.
Validation
test,dev, andmimicextras:uv run python -m pytest source/isaaclab_mimic/test/test_locomanipulation_sdg_cfg.py source/isaaclab/test/app/test_launch_simulation_require_kit.py -q— 16 passed.uv run python -m pytest source/isaaclab/test/controllers/test_pink_ik_components.py -q— 21 passed.uv run isaaclab -fand changelog validation passed.Type of change
Release backport
developChecklist