Commit 2222079
authored
[Fix] Allow Warp environments to launch with the Kit visualizer (#6111)
## Summary
- 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`).
- Aligns the Warp environments' visualizer / rendering checks with the
stable (non-Warp) environments.
## 1. Problem
`play.py --task Isaac-Velocity-Flat-Unitree-Go2-Warp-Play-v0
--visualizer kit` crashes during `gym.make`:
```
File ".../isaaclab_experimental/envs/manager_based_env_warp.py", line 165, in __init__
available_visualizers = [v.strip() for v in viz_str.split(",") if v.strip()]
AttributeError: 'dict' object has no attribute 'split'
```
## 2. 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. The sibling
`bool(...)` reads of the same parent node are silently always-true (the
subtree always exists after launch).
## 3. Fix
Align the Warp environments with the stable ones:
- `manager_based_env_warp.py`: viewport setup →
`has_active_visualizers()` + `has_kit()` (mirrors
`manager_based_env.py`); in-loop `is_rendering` →
`self.sim.is_rendering`.
- `direct_rl_env_warp.py`: UI-window gate → `self.sim.has_gui` (mirrors
`direct_rl_env.py`); in-loop `is_rendering` → `self.sim.is_rendering`
(drops a redundant manual rtx-sensor check folded into the property).
## 4. Validation
Reproduced the exact reported command on a GPU, before and after the
fix:
- **Without the fix:** crashes at `gym.make` with `AttributeError:
'dict' object has no attribute 'split'` (never reaches checkpoint
loading).
- **With the fix:** environment constructs, the checkpoint loads, and
play runs (`--visualizer kit`). `train.py` for the same task also
completes.1 parent 6b66819 commit 2222079
3 files changed
Lines changed: 21 additions & 11 deletions
File tree
- source/isaaclab_experimental
- changelog.d
- isaaclab_experimental/envs
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
| 420 | + | |
| 421 | + | |
423 | 422 | | |
424 | 423 | | |
425 | 424 | | |
| |||
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| |||
537 | 538 | | |
538 | 539 | | |
539 | 540 | | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
| 541 | + | |
| 542 | + | |
544 | 543 | | |
545 | 544 | | |
546 | 545 | | |
| |||
0 commit comments