Skip to content

fix: respect --viz flag in lift_cube_sm.py#6017

Open
Ottohere-Mourn wants to merge 1 commit into
isaac-sim:mainfrom
Ottohere-Mourn:fix/issue-5572
Open

fix: respect --viz flag in lift_cube_sm.py#6017
Ottohere-Mourn wants to merge 1 commit into
isaac-sim:mainfrom
Ottohere-Mourn:fix/issue-5572

Conversation

@Ottohere-Mourn

Copy link
Copy Markdown

Summary

  • Fixed scripts/environments/state_machine/lift_cube_sm.py to pass the full args_cli to AppLauncher instead of only headless=args_cli.headless
  • This ensures the --viz kit flag is properly respected when launching the state machine demo
  • One-line fix as identified in the issue

Fixes #5572

Test Plan

  • ./isaaclab.sh -p scripts/environments/state_machine/lift_cube_sm.py --viz kit now correctly opens the Kit/Isaac Sim visualizer
  • --headless mode continues to work as before

🤖 Generated with Claude Code

Fixes isaac-sim#5572

The AppLauncher was receiving only headless=args_cli.headless instead of
the full args_cli, causing the --viz kit flag to be silently ignored.

Signed-off-by: Ottohere-Mourn <3311436628@qq.com>
@Ottohere-Mourn Ottohere-Mourn requested a review from ooctipus as a code owner June 7, 2026 07:34
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Jun 7, 2026
@greptile-apps

greptile-apps Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes lift_cube_sm.py to pass the full args_cli namespace to AppLauncher instead of only headless=args_cli.headless, aligning it with the established pattern used by all other scripts in the repository.

  • One-line fix: AppLauncher(headless=args_cli.headless)AppLauncher(args_cli), restoring support for all CLI flags (--viz, --device, --cpu, etc.) that AppLauncher.add_app_launcher_args registers on the parser.
  • Consistent with codebase: Every other script under scripts/ already uses AppLauncher(args_cli); this file was the only outlier using the narrower call form.

Confidence Score: 5/5

Safe to merge — the single-line change is correct and consistent with the rest of the codebase.

Every other script in the repository already calls AppLauncher(args_cli). This change brings lift_cube_sm.py in line with that pattern, and there are no other side-effects to consider in such a narrow fix.

No files require special attention.

Important Files Changed

Filename Overview
scripts/environments/state_machine/lift_cube_sm.py Passes full args_cli to AppLauncher instead of only headless=args_cli.headless, matching the standard pattern used throughout the codebase.

Sequence Diagram

sequenceDiagram
    participant CLI as CLI / User
    participant Parser as argparse.ArgumentParser
    participant AL as AppLauncher
    participant App as simulation_app

    CLI->>Parser: parse_args() → args_cli
    Note over Parser: --headless, --viz, --device, etc.

    alt Before fix (broken)
        Parser->>AL: "AppLauncher(headless=args_cli.headless)"
        Note over AL: --viz and other flags ignored
    else After fix (correct)
        Parser->>AL: AppLauncher(args_cli)
        Note over AL: All flags honoured
    end

    AL->>App: app_launcher.app
Loading

Reviews (1): Last reviewed commit: "fix: pass args_cli to AppLauncher so --v..." | Re-trigger Greptile

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review — PR #6017

Summary

Clean, minimal fix that addresses a real usability bug. The change correctly passes the full args_cli namespace to AppLauncher instead of only extracting headless, which was silently dropping all other CLI flags (--viz, --livestream, --device, --offscreen_render, etc.).


🔬 Design Assessment

Correct approach. The AppLauncher.__init__ signature is:

def __init__(self, launcher_args: argparse.Namespace | dict | None = None, **kwargs):

Passing args_cli (an argparse.Namespace) directly is the canonical pattern used throughout the codebase (e.g., scripts/tutorials/, scripts/environments/zero_agent.py). The old headless=args_cli.headless pattern was an oversight that existed since the script was first written.

Cross-module impact: Self-contained — this is a standalone demo script with no downstream consumers.


Findings

🟡 Same bug exists in sibling scriptsscripts/environments/state_machine/

The following files have the identical anti-pattern (AppLauncher(headless=args_cli.headless)) and should be fixed in this PR or a follow-up:

  • scripts/environments/state_machine/open_cabinet_sm.py
  • scripts/environments/state_machine/lift_teddy_bear.py
  • scripts/tutorials/04_sensors/run_frame_transformer.py

Since these are all single-line changes with the same root cause, including them here would be low-risk and high-value. Alternatively, note them as a follow-up issue.

🔵 Improvement: Consider adding a note to CHANGELOG.rst

This fixes user-facing behavior (CLI flags being silently ignored). A brief entry under the relevant release section would help users who hit this issue and are searching the changelog for resolution.


🔍 Silent Failure Note

The original code was a textbook silent failure — users passing --viz kit would see no error, no warning, but the visualizer simply wouldn't open. The fix eliminates this by forwarding all parsed arguments to AppLauncher, which handles each flag appropriately.


🧪 Test Coverage

This is a demo script (not a library component), so the manual test plan in the PR description is appropriate:

  • --viz kit opens the visualizer ✓
  • --headless continues to work ✓

No automated regression test is needed here — the script isn't covered by unit tests, and adding one would require a full Isaac Sim runtime.


Verdict

Ship it (with minor suggestion to batch-fix sibling scripts). The change is correct, minimal, follows established patterns, and fixes a real user-facing bug. Well done! 🚀

@AntoineRichard

Copy link
Copy Markdown
Collaborator

Should this PR be targeting develop? I don't think main has a --viz arg?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] lift_cube_sm.py ignores --viz kit in Isaac Lab 3.0 beta

2 participants