Delegates close stage logic in SimulationContext to Stage utility#4688
Open
ooctipus wants to merge 1 commit intoisaac-sim:developfrom
Open
Delegates close stage logic in SimulationContext to Stage utility#4688ooctipus wants to merge 1 commit intoisaac-sim:developfrom
ooctipus wants to merge 1 commit intoisaac-sim:developfrom
Conversation
Contributor
Greptile SummaryThis PR successfully refactors stage teardown logic by consolidating stage cleanup into the Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[SimulationContext.clear_instance] --> B{Stage Teardown}
B --> C[stage_utils.close_stage]
C --> D[Clear UsdUtils.StageCache]
C --> E[Set _context.stage = None]
C --> F{Kit Running?}
F -->|Yes| G[omni.usd.get_context.close_stage]
F -->|No| H[Skip Kit Context Cleanup]
I[Script Files] --> J{Stage Access}
J -->|Get Stage| K[sim_utils.get_current_stage]
J -->|Close Stage| L[sim_utils.close_stage]
K -.->|abstracts| M[omni.usd.get_context.get_stage]
L -.->|abstracts| G
style C fill:#90EE90
style A fill:#87CEEB
style I fill:#FFD700
Last reviewed commit: d873772 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the code further
Removes remaining refactorable omni.usd usage
Refactores
SimulationContext.clear_instanceto delegate stage teardown toisaaclab.sim.utils.close_stageinstead of manually clearing the stage cache,thread-local context, and Kit USD context inline.
Updates
isaaclab.sim.utils.close_stageto also close the Kit USD context stage(
omni.usd.get_context().close_stage()) when Kit is running, making it a completestage teardown function.
Fixes # (issue)
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there