-
Notifications
You must be signed in to change notification settings - Fork 3k
Replaces Isaac Sim SimulationManager with IsaacLab SimulationManager #4475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
6fd9082
dcc4737
fcf6c1a
f54ae43
2f9afad
c1413d4
4652ac6
a10e419
a1a714d
d347aef
9929597
263054d
53a8ddb
590ff75
8e5153f
17d6936
836d0c6
62361ac
113ac86
b33eb9a
c7f6b23
b406521
dc62696
083a2c3
366f338
8c5e7c1
618e2f1
bd98dda
56cf54d
cbbccdf
33576d4
381d489
b1b5350
3a085d1
a75f85d
a5a9648
98d3388
e4eee14
4aab3c5
9de9fea
b5d1e38
3145c52
82f10f4
9104778
8527b3b
6834e09
9faf081
dad21af
67faf0a
2bc8c1e
ac1619b
9bfada7
6a7d78d
28f1348
582d281
1b3f82a
e8afe79
f504226
34a0770
bf10837
b77a28c
865502d
8e5d080
bddd0c2
8da331f
a253344
58d031b
2928529
dcf8d10
25a313e
bcee357
51d68c0
c81a2d9
a2f6548
1d8d50a
832db86
fae3e0c
3b6fb8a
e77de12
f1afe76
b0a2949
567c10d
2a42985
68bb030
eed1305
11625d7
d94635d
ceeaf5e
c7b8437
682ddfd
5b97b78
ffcf770
32f4165
a4bd7cb
2d6d8ad
11a9c25
db9e25d
0672828
a120b91
235a9e8
283669f
a530d7e
62e0a98
031f171
f248424
f9e29e3
17ce717
3d6f1a4
e1e1302
d7d952e
8c9ae3a
d4c99f1
d3e4f73
83d7c8b
1f297d1
8d277e9
3707bb0
17e62fc
53cb6fa
c89b550
930985f
68a9a6c
7d13fb9
0cb95dd
4c238f5
a82e8c7
fadd8e7
13920ef
6ac6ed4
8e24e52
5315495
6be6ac8
dc20d8e
4b1d3ae
1a11880
07c0573
81c91d1
1538f48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ keywords = ["experience", "app", "usd"] | |
| "isaacsim.core.api" = {} | ||
| "isaacsim.core.cloner" = {} | ||
| "isaacsim.core.nodes" = {} | ||
| "isaacsim.core.simulation_manager" = {} | ||
| # "isaacsim.core.simulation_manager" = {} # Replaced by isaaclab.sim.simulation_manager | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be removed directly? |
||
| "isaacsim.core.throttling" = {} | ||
| "isaacsim.core.utils" = {} | ||
| "isaacsim.core.version" = {} | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we remove the isaacsim_4_5 apps or do we plan on supporting those still? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ keywords = ["experience", "app", "usd"] | |
| "isaacsim.core.api" = {} | ||
| "isaacsim.core.cloner" = {} | ||
| "isaacsim.core.nodes" = {} | ||
| "isaacsim.core.simulation_manager" = {} | ||
| # "isaacsim.core.simulation_manager" = {} # Replaced by isaaclab.sim.simulation_manager | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can just be removed? |
||
| "isaacsim.core.throttling" = {} | ||
| "isaacsim.core.utils" = {} | ||
| "isaacsim.core.version" = {} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
|
|
||
| import omni.kit.app | ||
| import omni.timeline | ||
| from isaacsim.core.simulation_manager import IsaacEvents, SimulationManager | ||
| from isaaclab.sim import IsaacEvents, PhysxManager | ||
|
|
||
| import isaaclab.sim as sim_utils | ||
| from isaaclab.sim.utils.stage import get_current_stage | ||
|
|
@@ -295,7 +295,7 @@ def safe_callback(callback_name, event, obj_ref): | |
| order=10, | ||
| ) | ||
| # register prim deletion callback | ||
| self._prim_deletion_callback_id = SimulationManager.register_callback( | ||
| self._prim_deletion_callback_id = PhysxManager.register_callback( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the callbacks should live in the simulation context. It's something that we could take a look at in an other PR. |
||
| lambda event, obj_ref=obj_ref: safe_callback("_on_prim_deletion", event, obj_ref), | ||
| event=IsaacEvents.PRIM_DELETION, | ||
| ) | ||
|
|
@@ -308,15 +308,18 @@ def _initialize_callback(self, event): | |
| called whenever the simulator "plays" from a "stop" state. | ||
| """ | ||
| if not self._is_initialized: | ||
| # obtain simulation related information | ||
| self._backend = SimulationManager.get_backend() | ||
| self._device = SimulationManager.get_physics_sim_device() | ||
| # initialize the asset | ||
| try: | ||
| # Obtain Simulation Context | ||
| sim = sim_utils.SimulationContext.instance() | ||
| if sim is None: | ||
| raise RuntimeError("Simulation Context is not initialized!") | ||
| # Obtain device and backend | ||
| self._device = sim.device | ||
| # initialize the asset | ||
| self._initialize_impl() | ||
| except Exception as e: | ||
| if builtins.ISAACLAB_CALLBACK_EXCEPTION is None: | ||
| builtins.ISAACLAB_CALLBACK_EXCEPTION = e | ||
| if builtins.ISAACLAB_CALLBACK_EXCEPTION is None: # type: ignore | ||
| builtins.ISAACLAB_CALLBACK_EXCEPTION = e # type: ignore | ||
| # set flag | ||
| self._is_initialized = True | ||
|
|
||
|
|
@@ -327,15 +330,16 @@ def _invalidate_initialize_callback(self, event): | |
| self._debug_vis_handle.unsubscribe() | ||
| self._debug_vis_handle = None | ||
|
|
||
| def _on_prim_deletion(self, prim_path: str) -> None: | ||
| def _on_prim_deletion(self, event) -> None: | ||
| """Invalidates and deletes the callbacks when the prim is deleted. | ||
|
|
||
| Args: | ||
| prim_path: The path to the prim that is being deleted. | ||
| event: The prim deletion event containing the prim path in payload. | ||
|
|
||
| Note: | ||
| This function is called when the prim is deleted. | ||
| """ | ||
| prim_path = event.payload["prim_path"] | ||
| if prim_path == "/": | ||
| self._clear_callbacks() | ||
| return | ||
|
|
@@ -345,10 +349,14 @@ def _on_prim_deletion(self, prim_path: str) -> None: | |
| if result: | ||
| self._clear_callbacks() | ||
|
|
||
| def _clear_callbacks(self) -> None: | ||
| """Clears the callbacks.""" | ||
| def _clear_callbacks(self, event: Any = None) -> None: | ||
| """Clears the callbacks. | ||
|
|
||
| Args: | ||
| event: Optional event that triggered the callback (unused but required for event handlers). | ||
| """ | ||
| if self._prim_deletion_callback_id: | ||
| SimulationManager.deregister_callback(self._prim_deletion_callback_id) | ||
| PhysxManager.deregister_callback(self._prim_deletion_callback_id) | ||
| self._prim_deletion_callback_id = None | ||
| if self._initialize_handle: | ||
| self._initialize_handle.unsubscribe() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove the isaacsim_4_5 apps or do we plan on supporting those still?