Skip to content

[Fix] Unbreak the add_new_robot tutorial - #7327

Merged
kellyguo11 merged 7 commits into
isaac-sim:developfrom
hujc7:jichuanh/fix-add-new-robot-tutorial
Aug 31, 2026
Merged

[Fix] Unbreak the add_new_robot tutorial#7327
kellyguo11 merged 7 commits into
isaac-sim:developfrom
hujc7:jichuanh/fix-add-new-robot-tutorial

Conversation

@hujc7

@hujc7 hujc7 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

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:

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

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

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • No documentation change is required; the tutorial text already describes keyword construction
  • 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
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

hujc7 added 4 commits August 24, 2026 16:54
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.
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team infrastructure labels Aug 24, 2026
hujc7 added 3 commits August 29, 2026 22:17
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.
@hujc7 hujc7 changed the title [Fix] Unbreak the add_new_robot tutorial by restoring InteractiveSceneCfg positional slots [Fix] Unbreak the add_new_robot tutorial Aug 30, 2026
@hujc7
hujc7 marked this pull request as ready for review August 30, 2026 05:24
@hujc7
hujc7 requested a review from a team August 30, 2026 05:24
@hujc7

hujc7 commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@hujc7

hujc7 commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator Author

Believe the tutorial is getting removed? fixing anyway for now. @StafaH

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Aug 30, 2026

@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 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_envs removes 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_envs value 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-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR repairs the add_new_robot tutorial for startup and multi-environment execution.

  • Passes num_envs by keyword to avoid dependence on inherited dataclass field order.
  • Expands both Jetbot wheel-action templates to the scene’s environment count.

Confidence Score: 5/5

The 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

Filename Overview
scripts/tutorials/01_assets/add_new_robot.py The scene configuration now binds num_envs correctly, and the wheel targets match the setter’s required (num_envs, 2) shape.

Reviews (1): Last reviewed commit: "Drop the standalone tutorial CI jobs" | Re-trigger Greptile

@kellyguo11
kellyguo11 merged commit beb6fc3 into isaac-sim:develop Aug 31, 2026
46 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as adf8d9c.

isaaclab-bot Bot pushed a commit that referenced this pull request Aug 31, 2026
## 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants