[Fix] Unbreak the add_new_robot tutorial - #7327
Conversation
Commit 0a0dc1b ("Support Multi-Backend for Demo Scripts", isaac-sim#5938) added class_type as the first field of InteractiveSceneCfg. Because configclass builds a dataclass, declaration order is the positional __init__ signature, so every scene configuration constructed as MySceneCfg(num_envs, env_spacing) began assigning num_envs into class_type and failing validation with "Missing values detected ... num_envs". Declare class_type last instead. Nothing reads it positionally, and InteractiveScene._collect_asset_cfgs excludes base fields by name via InteractiveSceneCfg.__dataclass_fields__, so ordering is inert there.
Pass num_envs by keyword so the tutorial does not depend on the positional slot order of InteractiveSceneCfg, which is what broke it when class_type was inserted ahead of num_envs. Size the wheel-velocity actions to the scene instead of hard-coding a batch of one. Any --num_envs greater than one previously aborted in the first step with "Shape mismatch: torch.Size([1, 2]) != (2, 2)".
Both standalone script jobs pass standalone-script-scope "demos", and select_script_scope keeps only scripts/demos, so the 24 tutorial scripts were discovered and given readiness markers but never actually launched. That is why the add_new_robot regression survived from its merge to SQA. Add the matching tutorials-scope jobs for the Kit and non-Kit runtime groups.
…-new-robot-tutorial
…-new-robot-tutorial
Every peer base configuration declares class_type first: AssetBaseCfg, ActuatorBaseCfg, ActionTermCfg, CommandTermCfg and RecorderTermCfg. Moving it last made InteractiveSceneCfg the sole outlier. The reorder was also unnecessary. The repository contains exactly one positional scene-configuration construction, in add_new_robot.py, which this branch already fixes by passing num_envs as a keyword. Every other call site and all five documented examples already use keywords. Drop the changelog fragment with it: no source package changes any more, so tools/changelog/cli.py requires none.
The tutorials are slated for removal, so wiring them into the launch matrix is not worth two additional required status checks. The coverage gap itself stands: both standalone-script jobs pass standalone-script-scope "demos", so select_script_scope filters every scripts/tutorials path out of CASES. Tutorials are still discovered and marker-checked, just never launched.
|
run-ci |
|
Believe the tutorial is getting removed? fixing anyway for now. @StafaH |
There was a problem hiding this comment.
Isaac Lab Review Bot
The tutorial now constructs NewRobotsSceneCfg with an explicit num_envs keyword and sizes both Jetbot wheel-velocity targets for every configured environment. The changes directly address constructor-order sensitivity and multi-environment target-shape handling.
- Design and architecture: Using a keyword for
num_envsremoves the tutorial’s dependence on inherited configuration-field ordering while keeping the fix localized to the affected caller. No shared configuration design or library architecture is changed. - API: No public API, export, default, or configuration contract is modified. The existing
scene.num_envsvalue is used to produce per-environment joint targets, consistent with the surrounding per-environment state handling. - Implementation: Both action templates are created on the simulation device and repeated to shape
[scene.num_envs, 2]once before the simulation loop, preserving reuse across steps without introducing per-step allocation. The single-environment behavior remains equivalent while multi-environment runs receive one target row per environment.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
Greptile SummaryThis PR repairs the
Confidence Score: 5/5The PR appears safe to merge, with both tutorial failures corrected consistently with the underlying configuration and actuator APIs. Keyword construction correctly populates the inherited scene fields, while repeating the two-wheel command rows produces the exact batch shape required for every cloned Jetbot. Important Files Changed
Reviews (1): Last reviewed commit: "Drop the standalone tutorial CI jobs" | Re-trigger Greptile |
|
Backported to |
## Summary `scripts/tutorials/01_assets/add_new_robot.py` crashes on startup on `develop` and `release/3.0.0`, and aborts on the first step for any `--num_envs` greater than one. Two lines in the tutorial; no library change. # Description The tutorial constructed its scene configuration positionally: ```python scene_cfg = NewRobotsSceneCfg(args_cli.num_envs, env_spacing=2.0) ``` `@configclass` builds a dataclass, so field declaration order *is* the positional `__init__` signature. Commit 0a0dc1b ("Support Multi-Backend for Demo Scripts", #5938) added `class_type` as the first field of `InteractiveSceneCfg`, so `num_envs` began landing in the `class_type` slot: ``` TypeError: Missing values detected in object NewRobotsSceneCfg for the following fields: - num_envs ``` Fixes NVBug 6652234. ## Changes 1. Pass `num_envs` by keyword. This is the form every other scene-configuration construction in the repository and all five documented examples already use. `class_type` stays first in `InteractiveSceneCfg`, consistent with `AssetBaseCfg`, `ActuatorBaseCfg`, `ActionTermCfg`, `CommandTermCfg` and `RecorderTermCfg`. 2. Size the wheel-velocity action templates to `scene.num_envs`. A second, independent defect meant `--num_envs` greater than one aborted on the first step with `Shape mismatch: torch.Size([1, 2]) != (2, 2)`. Not addressed here: both standalone-script jobs pass `standalone-script-scope: "demos"`, so `select_script_scope` filters every `scripts/tutorials` path out of the launch matrix. Tutorials are discovered and marker-checked but never launched, which is why this survived to SQA. Left as-is; the tutorials are slated for removal. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [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 `./isaaclab.sh --format` - [ ] No documentation change is required; the tutorial text already describes keyword construction - [x] My changes generate no new warnings - [ ] No test added: the fix is a three-line correction to a tutorial script that CI does not launch - [ ] A package changelog fragment is not required because no source package changed - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there (cherry picked from commit beb6fc3)
Summary
scripts/tutorials/01_assets/add_new_robot.pycrashes on startup ondevelopandrelease/3.0.0, and aborts on the first step for any--num_envsgreater than one.Two lines in the tutorial; no library change.
Description
The tutorial constructed its scene configuration positionally:
@configclassbuilds a dataclass, so field declaration order is the positional__init__signature. Commit 0a0dc1b ("Support Multi-Backend for Demo Scripts", #5938)added
class_typeas the first field ofInteractiveSceneCfg, sonum_envsbeganlanding in the
class_typeslot:Fixes NVBug 6652234.
Changes
num_envsby keyword. This is the form every other scene-configurationconstruction in the repository and all five documented examples already use.
class_typestays first inInteractiveSceneCfg, consistent withAssetBaseCfg,ActuatorBaseCfg,ActionTermCfg,CommandTermCfgandRecorderTermCfg.scene.num_envs. A second, independentdefect meant
--num_envsgreater than one aborted on the first step withShape mismatch: torch.Size([1, 2]) != (2, 2).Not addressed here: both standalone-script jobs pass
standalone-script-scope: "demos",so
select_script_scopefilters everyscripts/tutorialspath out of the launch matrix.Tutorials are discovered and marker-checked but never launched, which is why this survived
to SQA. Left as-is; the tutorials are slated for removal.
Type of change
Release backport
developChecklist
pre-commitchecks with./isaaclab.sh --formatCONTRIBUTORS.mdor my name already exists there