Fixes ActionTerm.set_debug_vis crash in kitless mode#5399
Fixes ActionTerm.set_debug_vis crash in kitless mode#5399kellyguo11 wants to merge 2 commits intoisaac-sim:developfrom
Conversation
Greptile SummaryThis PR fixes a Confidence Score: 5/5Safe to merge — minimal, targeted bug fix with no side effects. Single-line fix that adds a No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Env as Environment
participant AM as ActionTerm.set_debug_vis
participant Kit as omni.kit.app
Env->>AM: set_debug_vis(debug_vis=True)
AM->>AM: has_debug_vis_implementation?
AM->>AM: _set_debug_vis_impl(debug_vis)
alt has_kit() == False (kitless mode)
AM->>AM: skip omni.kit.app block (else: cleanup handle)
AM-->>Env: return True
else has_kit() == True
AM->>Kit: get_app_interface()
Kit-->>AM: app_interface
AM->>AM: create post-update subscription
AM-->>Env: return True
end
Reviews (1): Last reviewed commit: "Fixes ActionTerm.set_debug_vis crash in ..." | Re-trigger Greptile |
73f830d to
31a7399
Compare
ActionTerm.set_debug_vis unconditionally referenced omni.kit.app without checking has_kit(), causing a NameError when running without Kit (e.g. Newton backend). This matches the existing guard in CommandTerm.set_debug_vis which already checks 'if debug_vis and has_kit()'. The bug caused any environment with debug_vis=True on an action term (e.g. Isaac-Navigation-Flat-Anymal-C) to crash immediately on creation in kitless/headless configurations.
31a7399 to
24c3572
Compare
Description
ActionTerm.set_debug_viscrashes withNameError: name 'omni' is not definedwhen running in Kit-based headless mode. This affects any environment withdebug_vis=Trueon an action term (e.g.Isaac-Navigation-Flat-Anymal-CviaPreTrainedPolicyAction).Root cause: Two issues compound:
import omni.kit.appis guarded byif has_kit():, buthas_kit()returnsFalseat module import time (before Kit is initialized insys.modules), so the import is skipped.set_debug_viscallsomni.kit.app.get_app_interface()unconditionally —omniis not in scope because the import was skipped.Fix
Two changes to
ActionTerm.set_debug_vis:has_kit()guard to thedebug_vischeck, matching the existing pattern inCommandTerm.set_debug_vis(command_manager.py:112).import omni.kit.appinside the guarded block, so the import resolves correctly even when the top-level conditional import was skipped at module load time.Tested:
Isaac-Navigation-Flat-Anymal-C-v0now trains successfully in headless mode (1500 iterations, previously crashed immediately).Type of change
Checklist
./isaaclab.sh --format