Skip to content

[Fix] Allow Warp environments to launch with the Kit visualizer (cherry-pick of #6111)#6139

Open
hujc7 wants to merge 2 commits into
isaac-sim:release/3.0.0-beta2from
hujc7:jichuanh/fix-warp-env-visualizer-setting-beta2
Open

[Fix] Allow Warp environments to launch with the Kit visualizer (cherry-pick of #6111)#6139
hujc7 wants to merge 2 commits into
isaac-sim:release/3.0.0-beta2from
hujc7:jichuanh/fix-warp-env-visualizer-setting-beta2

Conversation

@hujc7

@hujc7 hujc7 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Cherry-pick of #6111 onto release/3.0.0-beta2.

Fixes a crash when launching the experimental Warp environments with a Kit visualizer (--visualizer kit): AttributeError: 'dict' object has no attribute 'split' at environment construction. Reported by QA across ~10 manager-based Warp tasks (velocity/reach, e.g. Isaac-Velocity-Flat-Unitree-Go2-Warp-Play-v0).

Root cause

The Warp environments read the parent settings node /isaaclab/visualizer, which carb returns as a dict of the {types, explicit, disable_all, max_visible_envs} subtree that AppLauncher writes — then call .split(",") on it. The stable environments never do this: they read /isaaclab/visualizer/types via SimulationContext.has_active_visualizers() and the is_rendering property, which also guard against non-string values.

Fix

Align the Warp environments with the stable ones:

  • manager_based_env_warp.py: viewport setup → has_active_visualizers() + has_kit(); in-loop is_renderingself.sim.is_rendering.
  • direct_rl_env_warp.py: UI-window gate → self.sim.has_gui; in-loop is_renderingself.sim.is_rendering.

See #6111 for full discussion and validation.

hujc7 added 2 commits June 11, 2026 06:23
The experimental Warp environments read the parent settings node
"/isaaclab/visualizer", which carb returns as a dictionary of the
visualizer settings subtree, then called .split(",") on it. Requesting a
Kit visualizer (e.g. --visualizer kit) therefore crashed at construction
with: AttributeError: 'dict' object has no attribute 'split'.

Resolve the active visualizer through SimulationContext.has_active_visualizers()
and the is_rendering property, matching the stable (non-Warp) environments,
which read the "/isaaclab/visualizer/types" string and guard against
non-string values. Also drop the equivalent always-true bool() reads of the
same parent node in the manager-based and direct Warp step loops and window
setup.
Inline self.sim.has_active_visualizers() into the viewport-controller
guard since the local was used only once. Correct the in-loop
is_rendering comment: the property does live settings lookups and is
hoisted out of the decimation loop, it is not cached.
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Jun 11, 2026
@greptile-apps

greptile-apps Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes a crash (AttributeError: 'dict' object has no attribute 'split') in the experimental Warp environments when launched with --visualizer kit, by replacing direct carb settings reads on the parent /isaaclab/visualizer node (which returns a dict) with the same API the stable environments already use.

  • manager_based_env_warp.py: Viewport controller initialisation now uses (sim.has_gui or sim.has_active_visualizers()) and has_kit() — reading the correct /isaaclab/visualizer/types sub-key — replacing the buggy string-split on the parent dict; is_rendering hoist uses self.sim.is_rendering instead of the raw dict/rtx-sensor settings lookups.
  • direct_rl_env_warp.py: UI window guard replaced with self.sim.has_gui; is_rendering now uses the same self.sim.is_rendering property, dropping the partially-broken _has_rtx fallback and the always-true bool(dict) visualizer check.
  • Both changes align the Warp environments exactly with the stable ManagerBasedEnv / DirectRLEnv implementations.

Confidence Score: 5/5

Safe to merge — all three changes are targeted, well-scoped, and directly mirror the stable environment implementations that are already in production.

Each changed line replaces a broken settings lookup with a method that the stable environments have used without incident. The viewport-controller guard now correctly reads /isaaclab/visualizer/types (a string) via has_active_visualizers() instead of the parent dict node; the is_rendering hoist is the exact same one-liner used in ManagerBasedEnv.step(); and the UI-window guard in DirectRLEnvWarp now matches DirectRLEnv word-for-word. No new code paths are introduced, no external contracts change, and the changelog is accurate.

No files require special attention; both env files are straightforward one-to-one replacements of broken patterns with their proven stable counterparts.

Important Files Changed

Filename Overview
source/isaaclab_experimental/isaaclab_experimental/envs/manager_based_env_warp.py Viewport controller init now uses has_active_visualizers() + has_kit() (matching stable ManagerBasedEnv); is_rendering hoist replaced raw dict settings lookup with self.sim.is_rendering.
source/isaaclab_experimental/isaaclab_experimental/envs/direct_rl_env_warp.py UI window guard changed from bool(settings.get('/isaaclab/visualizer')) to self.sim.has_gui; is_rendering hoist replaced raw dict/rtx lookup with self.sim.is_rendering — both aligned with stable DirectRLEnv.
source/isaaclab_experimental/changelog.d/fix-warp-env-visualizer-setting.rst New changelog entry accurately describing the AttributeError crash and the fix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Environment __init__] --> B{Viewport Camera Controller}
    B -->|old Warp code| C["get_setting('/isaaclab/visualizer')\n→ returns dict\n→ .split() → AttributeError"]
    B -->|new Warp code| D{"(has_gui OR has_active_visualizers())\nAND has_kit()"}
    D -->|True| E[ViewportCameraController created]
    D -->|False| F[viewport_camera_controller = None]
    A --> G[step loop]
    G -->|old Warp code| H["is_rendering = bool(settings.get('/isaaclab/visualizer')) OR rtx_sensors"]
    G -->|new Warp code| I["is_rendering = self.sim.is_rendering\n(GUI | offscreen | rtx_sensors | visualizers | XR)"]
    I --> J[decimation loop]
    H --> J
    J --> K{"sim_step % render_interval == 0 AND is_rendering"}
    K -->|Yes| L[sim.render]
    K -->|No| M[skip render]
Loading

Reviews (1): Last reviewed commit: "Address review: inline single-use visual..." | 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.

Review Summary

This PR correctly fixes the AttributeError crash when launching Warp environments with Kit visualizer by replacing the broken string-parsing of the /isaaclab/visualizer settings node (which is actually a dict) with the same well-tested API surface used by the stable environments.

Verdict: Clean, minimal fix that brings the experimental Warp environments into alignment with the stable (ManagerBasedRLEnv, DirectRLEnv) code paths. The changes are consistent and well-scoped.


✅ What works well

  1. Consistent pattern adoption — All three replacements (has_gui, is_rendering, has_active_visualizers() + has_kit()) mirror the stable environment implementations exactly.
  2. is_rendering subsumes both old checks — The property internally covers GUI, offscreen render, RTX sensors, active visualizers, and XR, so the old _has_rtx guard and the /isaaclab/visualizer string check are both properly replaced with a single, well-maintained property.
  3. Good changelog fragment — Clear description referencing the relevant classes and the error message.
  4. has_kit() guard — Prevents ViewportCameraController from being instantiated in kitless Newton-only runs, which would fail at import time.

💬 Minor observations (non-blocking)

File Observation
manager_based_env_warp.py:165 The stable manager_based_env.py (line 187) extracts has_visualizers = self.sim.has_active_visualizers() into a local before the condition. This PR inlines the call directly. Both are fine — just noting the stylistic divergence from the pattern this PR aims to match.
direct_rl_env_warp.py:420 Comment says "is_rendering does live settings lookups" — accurate since resolve_visualizer_types() and the RTX setting are fetched live. Worth confirming this matches the stable env's comment which says "uses cached property" (stable env line 537). The behavior is identical (hoisted out of the decimation loop), but the comments now diverge on whether the property is "cached" or "live". Consider aligning the wording with the stable counterpart for consistency.
direct_rl_env_warp.py The stable direct_rl_env.py also guards ViewportCameraController creation with has_active_visualizers() + has_kit() (line 169). The Warp variant does not appear to have a viewport_camera_controller at all — likely intentional for the experimental path, but worth confirming the camera controller isn't needed here.

🧪 Testing

No new tests were added, which is acceptable for a cherry-pick of an already-reviewed fix (#6111). The changelog fragment is present. CI checks (pre-commit, build wheel, changelog fragments) are passing; installation tests are still pending.


Overall: This is a straightforward, correct fix. The observations above are stylistic / informational only — no blocking issues found. 👍

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.

1 participant