Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
6fd9082
adds initial code and implementation for xform class
Mayankm96 Dec 30, 2025
dcc4737
wraps code inside sdf block for optimization
Mayankm96 Dec 30, 2025
fcf6c1a
runs formatter
Mayankm96 Dec 30, 2025
f54ae43
updates doc strings
Mayankm96 Dec 30, 2025
2f9afad
fixes type-hinting
Mayankm96 Dec 30, 2025
c1413d4
removes isaac sim xform class from create_prim
Mayankm96 Dec 30, 2025
4652ac6
moves functions for pose to transforms module
Mayankm96 Dec 30, 2025
a10e419
adds api docs
Mayankm96 Dec 30, 2025
a1a714d
makes a function to abstract out convert world pose call
Mayankm96 Dec 30, 2025
d347aef
runs formatter
Mayankm96 Dec 30, 2025
9929597
adds test for different backend data types to create prim
Mayankm96 Dec 30, 2025
263054d
adds test for get usd references
Mayankm96 Dec 30, 2025
53a8ddb
adds error code
Mayankm96 Dec 30, 2025
590ff75
adds example for all transform calls
Mayankm96 Dec 30, 2025
8e5153f
runs formatter
Mayankm96 Dec 30, 2025
17d6936
fixes type issues and adds more tests for to_tuple
Mayankm96 Jan 2, 2026
836d0c6
Merge branch 'main' into fix/clear-xform
Mayankm96 Jan 2, 2026
62361ac
adds test for flaot precision in standardize
Mayankm96 Jan 2, 2026
113ac86
removes benchmark test
Mayankm96 Jan 2, 2026
b33eb9a
makes a habit of sending stage
Mayankm96 Jan 2, 2026
c7f6b23
use stage attributes
Mayankm96 Jan 2, 2026
b406521
optimization for root parent
Mayankm96 Jan 2, 2026
dc62696
adds test to validate xform ops order
Mayankm96 Jan 2, 2026
083a2c3
adds benchmark script
Mayankm96 Jan 2, 2026
366f338
moves xform prim view into views module
Mayankm96 Jan 2, 2026
8c5e7c1
fixes type error
Mayankm96 Jan 2, 2026
618e2f1
adds test for xform prim view
Mayankm96 Jan 2, 2026
bd98dda
adds clear op
Mayankm96 Jan 2, 2026
56cf54d
adds franka test
Mayankm96 Jan 2, 2026
cbbccdf
fixes check for non-xform xformable
Mayankm96 Jan 2, 2026
33576d4
fixes usd path
Mayankm96 Jan 2, 2026
381d489
switches internals to use new xformview
Mayankm96 Jan 2, 2026
b1b5350
adds views to docs
Mayankm96 Jan 2, 2026
3a085d1
adds new implementations
Mayankm96 Jan 2, 2026
a75f85d
Merge branch 'fix/clear-xform' into feautre/xform-view
Mayankm96 Jan 2, 2026
a5a9648
removes unused initialize
Mayankm96 Jan 2, 2026
98d3388
switches to comparing with experimental api of isaacsim
Mayankm96 Jan 2, 2026
e4eee14
renames to XformPrimView
Mayankm96 Jan 2, 2026
4aab3c5
adds type ignore
Mayankm96 Jan 2, 2026
9de9fea
adds validation arg
Mayankm96 Jan 2, 2026
b5d1e38
fixes for new xform class
Mayankm96 Jan 2, 2026
3145c52
adds support for indices
Mayankm96 Jan 2, 2026
82f10f4
runs formatter
Mayankm96 Jan 2, 2026
9104778
modifies script to benchmark different xform apis
Mayankm96 Jan 2, 2026
8527b3b
uses xform cache
Mayankm96 Jan 2, 2026
6834e09
runs formatter
Mayankm96 Jan 2, 2026
9faf081
adds note for why we don't use the utils functions
Mayankm96 Jan 2, 2026
dad21af
fixes typehints
Mayankm96 Jan 2, 2026
67faf0a
use inplace operation for ortho
Mayankm96 Jan 2, 2026
2bc8c1e
ensures stage is cached for deletion
Mayankm96 Jan 2, 2026
ac1619b
updates changelog
Mayankm96 Jan 2, 2026
9bfada7
Merge branch 'fix/clear-xform' into feautre/xform-view
Mayankm96 Jan 2, 2026
6a7d78d
Merge branch 'main' into feautre/xform-view
Mayankm96 Jan 2, 2026
28f1348
removes exe from top
Mayankm96 Jan 2, 2026
582d281
fixes for extras
Mayankm96 Jan 2, 2026
1b3f82a
hopes
Mayankm96 Jan 2, 2026
e8afe79
Merge branch 'main' into feautre/xform-view
Mayankm96 Jan 2, 2026
f504226
Merge branch 'main' into feature/sim-context
Mayankm96 Jan 3, 2026
34a0770
moves to follow ordering
Mayankm96 Jan 3, 2026
bf10837
removes unused clear callbacks
Mayankm96 Jan 3, 2026
b77a28c
fixes run instructions
Mayankm96 Jan 3, 2026
865502d
reuse gravity
Mayankm96 Jan 3, 2026
8e5d080
fixes some bugs
Mayankm96 Jan 3, 2026
bddd0c2
removes other locations of clear_all_callbacks
Mayankm96 Jan 3, 2026
8da331f
hacks in some fixes
Mayankm96 Jan 3, 2026
a253344
handles different indexing schemes
Mayankm96 Jan 3, 2026
58d031b
fixes bug with indexing
Mayankm96 Jan 3, 2026
2928529
adds test for indexing
Mayankm96 Jan 3, 2026
dcf8d10
Merge branch 'feautre/xform-view' of github.com:Mayankm96/IsaacLab in…
Mayankm96 Jan 3, 2026
25a313e
moves file for naming
Mayankm96 Jan 3, 2026
bcee357
fixes doc
Mayankm96 Jan 3, 2026
51d68c0
format fixes
Mayankm96 Jan 3, 2026
c81a2d9
fixes initialization
Mayankm96 Jan 3, 2026
a2f6548
adds todos
Mayankm96 Jan 3, 2026
1d8d50a
adds more tests for sim context operations
Mayankm96 Jan 3, 2026
832db86
remove boundedness as that test is wrong
Mayankm96 Jan 3, 2026
fae3e0c
adds get physics dt for funsies
Mayankm96 Jan 3, 2026
3b6fb8a
adds callback tests
Mayankm96 Jan 3, 2026
e77de12
fixes imports
Mayankm96 Jan 3, 2026
f1afe76
fixes reset pausing
Mayankm96 Jan 3, 2026
b0a2949
adds test for isaac sim events
Mayankm96 Jan 3, 2026
567c10d
makes logger file more visible
Mayankm96 Jan 3, 2026
2a42985
typo
Mayankm96 Jan 3, 2026
68bb030
fixes info not logging to logger
Mayankm96 Jan 3, 2026
eed1305
makes formatter nicer
Mayankm96 Jan 3, 2026
11625d7
makes error bold red
Mayankm96 Jan 3, 2026
d94635d
fixes error from some code
Mayankm96 Jan 3, 2026
ceeaf5e
makes border length match
Mayankm96 Jan 3, 2026
c7b8437
fixes printing of table in articulation
Mayankm96 Jan 3, 2026
682ddfd
fies how check for callback is done
Mayankm96 Jan 3, 2026
5b97b78
fixes init errors
Mayankm96 Jan 3, 2026
ffcf770
comments out detach stage for now
Mayankm96 Jan 3, 2026
32f4165
uses simulation manager for context ops
Mayankm96 Jan 3, 2026
a4bd7cb
removes builtin check since we are always in non-app mode
Mayankm96 Jan 3, 2026
2d6d8ad
removes terminal check from other places
Mayankm96 Jan 3, 2026
11a9c25
adds test for exception raised in callbacks
Mayankm96 Jan 3, 2026
db9e25d
adds stage attribute to clear stage
Mayankm96 Jan 3, 2026
0672828
fixes callback calls
Mayankm96 Jan 3, 2026
a120b91
ensures exception are caught
Mayankm96 Jan 3, 2026
235a9e8
makes sure to not cache if added manually
Mayankm96 Jan 3, 2026
283669f
Merge branch 'main' into feature/sim-context
Mayankm96 Jan 3, 2026
a530d7e
Merge branch 'feautre/xform-view' into feature/sim-context
Mayankm96 Jan 3, 2026
62e0a98
Merge branch 'main' into feature/sim-context
Mayankm96 Jan 3, 2026
031f171
runs formatter
Mayankm96 Jan 3, 2026
f248424
add future import
Mayankm96 Jan 3, 2026
f9e29e3
mark unused
Mayankm96 Jan 3, 2026
17ce717
adds other settings
Mayankm96 Jan 3, 2026
3d6f1a4
adds missing residuals
Mayankm96 Jan 3, 2026
e1e1302
passes stage over for creating mdl material
Mayankm96 Jan 5, 2026
d7d952e
Merge branch 'main' into feature/sim-context
Mayankm96 Jan 7, 2026
8c9ae3a
adding fixes for stage in mem unit tests
matthewtrepte Jan 8, 2026
d4c99f1
fixes singleton destory, physics context removal, and consistent torc…
ooctipus Jan 27, 2026
d3e4f73
simulation manager addition
ooctipus Jan 27, 2026
83d7c8b
refactor step 1: removed has_gui api and refactor animation related c…
ooctipus Feb 1, 2026
1f297d1
refactor step 2: removed has rtx sensor api
ooctipus Feb 1, 2026
8d277e9
refactor step 3: removed is_fabric_enabled api
ooctipus Feb 1, 2026
3707bb0
refactor step 4: remove get_initial_stage api
ooctipus Feb 1, 2026
17e62fc
fix bugs in refactor
ooctipus Feb 1, 2026
53cb6fa
refactor step 5: refactored physx_backend from simulation context
ooctipus Feb 1, 2026
c89b550
refactor step 6: refactored visualizer_backend
ooctipus Feb 1, 2026
930985f
refactored visualizer interface further
ooctipus Feb 1, 2026
68a9a6c
refactore step 7: deprecating sim.app
ooctipus Feb 2, 2026
7d13fb9
refactor step 8: unified physics interface, physics backend, and phys…
ooctipus Feb 2, 2026
0cb95dd
refactor step 9: rename simulation manager to physx manager
ooctipus Feb 2, 2026
4c238f5
refactor step 10: refactored ov_visualizer from visualizer_interfaces
ooctipus Feb 2, 2026
a82e8c7
refactor step 11: refactor timeline out from ov visualizer
ooctipus Feb 2, 2026
fadd8e7
remove app public api from visualizer interface
ooctipus Feb 2, 2026
13920ef
refactor step 12: update visualizer_interface to be in accordance wit…
ooctipus Feb 2, 2026
6ac6ed4
refactor step 13: refactored visualizers to be newton consistent
ooctipus Feb 3, 2026
8e24e52
refactor step 14: refactored render mode out
ooctipus Feb 3, 2026
5315495
refactor step 15: refactored physics to lab.physics
ooctipus Feb 3, 2026
6be6ac8
refactor step 16: refactored physics_manager
ooctipus Feb 3, 2026
dc20d8e
refactor step 17: refactored simulation_cfg
ooctipus Feb 3, 2026
4b1d3ae
refactor step 18: refactored newton manager
ooctipus Feb 3, 2026
1a11880
added in dummy refactored visualizers to show structure
ooctipus Feb 3, 2026
07c0573
refactor step 19: reorganized interface
ooctipus Feb 3, 2026
81c91d1
refactor step 20: gets simulation_context tests to pass
ooctipus Feb 3, 2026
1538f48
made simulation manager a lot nicer
ooctipus Feb 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/isaaclab.python.kit
Copy link
Collaborator

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?

Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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" = {}
Expand Down
2 changes: 1 addition & 1 deletion apps/isaacsim_4_5/isaaclab.python.kit
Copy link
Collaborator

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?

Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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" = {}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/how-to/optimize_stage_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ be called after the stage is created.
sim = SimulationContext(cfg=SimulationCfg(create_stage_in_memory=True))
# grab stage in memory and set stage context
stage_in_memory = sim.get_initial_stage()
stage_in_memory = sim.stage
with stage_utils.use_stage(stage_in_memory):
# create cartpole scene
scene_cfg = CartpoleSceneCfg(num_envs=1024)
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmarks/benchmark_cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def inject_cameras_into_task(
"""Loads the task, sticks cameras into the config, and creates the environment."""
cfg = load_cfg_from_registry(task, "env_cfg_entry_point")
cfg.sim.device = args_cli.device
cfg.sim.use_fabric = args_cli.use_fabric
cfg.sim.physics_manager_cfg.use_fabric = args_cli.use_fabric
scene_cfg = cfg.scene

num_envs = int(num_cams / num_cameras_per_env)
Expand Down
5 changes: 2 additions & 3 deletions scripts/benchmarks/benchmark_view_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
import time
import torch

from isaacsim.core.simulation_manager import SimulationManager

from isaaclab.physics.physx_manager import PhysxManager
import isaaclab.sim as sim_utils
import isaaclab.utils.math as math_utils
from isaaclab.sim.views import XformPrimView
Expand Down Expand Up @@ -129,7 +128,7 @@ def benchmark_view(view_type: str, num_iterations: int) -> tuple[dict[str, float
num_prims = view.count
view_name = "XformPrimView"
else: # physx
physics_sim_view = SimulationManager.get_physics_sim_view()
physics_sim_view = PhysxManager.get_physics_sim_view()
view = physics_sim_view.create_rigid_body_view(pattern)
num_prims = view.count
view_name = "PhysX RigidBodyView"
Expand Down
1 change: 0 additions & 1 deletion scripts/benchmarks/benchmark_xform_prim_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ def benchmark_xform_prim_view(

# close simulation
sim.clear()
sim.clear_all_callbacks()
sim.clear_instance()

return timing_results, computed_results
Expand Down
2 changes: 1 addition & 1 deletion scripts/demos/quadcopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def main():
# Fetch relevant parameters to make the quadcopter hover in place
prop_body_ids = robot.find_bodies("m.*_prop")[0]
robot_mass = robot.root_physx_view.get_masses().sum()
gravity = torch.tensor(sim.cfg.gravity, device=sim.device).norm()
gravity = torch.tensor(sim.cfg.physics_manager_cfg.gravity, device=sim.device).norm()

# Now we are ready!
print("[INFO]: Setup complete...")
Expand Down
2 changes: 1 addition & 1 deletion scripts/environments/state_machine/lift_cube_sm.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def main():
desired_orientation[:, 1] = 1.0
# create state machine
pick_sm = PickAndLiftSm(
env_cfg.sim.dt * env_cfg.decimation, env.unwrapped.num_envs, env.unwrapped.device, position_threshold=0.01
env_cfg.sim.physics_manager_cfg.dt * env_cfg.decimation, env.unwrapped.num_envs, env.unwrapped.device, position_threshold=0.01
)

while simulation_app.is_running():
Expand Down
2 changes: 1 addition & 1 deletion scripts/environments/state_machine/lift_teddy_bear.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def main():
object_local_grasp_position = torch.tensor([0.02, -0.08, 0.0], device=env.unwrapped.device)

# create state machine
pick_sm = PickAndLiftSm(env_cfg.sim.dt * env_cfg.decimation, env.unwrapped.num_envs, env.unwrapped.device)
pick_sm = PickAndLiftSm(env_cfg.sim.physics_manager_cfg.dt * env_cfg.decimation, env.unwrapped.num_envs, env.unwrapped.device)

while simulation_app.is_running():
# run everything in inference mode
Expand Down
2 changes: 1 addition & 1 deletion scripts/environments/state_machine/open_cabinet_sm.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def main():
desired_orientation = torch.zeros((env.unwrapped.num_envs, 4), device=env.unwrapped.device)
desired_orientation[:, 1] = 1.0
# create state machine
open_sm = OpenDrawerSm(env_cfg.sim.dt * env_cfg.decimation, env.unwrapped.num_envs, env.unwrapped.device)
open_sm = OpenDrawerSm(env_cfg.sim.physics_manager_cfg.dt * env_cfg.decimation, env.unwrapped.num_envs, env.unwrapped.device)

while simulation_app.is_running():
# run everything in inference mode
Expand Down
2 changes: 1 addition & 1 deletion scripts/tools/check_instanceable.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"""Rest everything follows."""


from isaacsim.core.api.simulation_context import SimulationContext
from isaaclab.sim import SimulationContext
from isaacsim.core.cloner import GridCloner

import isaaclab.sim as sim_utils
Expand Down
2 changes: 1 addition & 1 deletion scripts/tutorials/03_envs/create_cartpole_base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def __post_init__(self):
# step settings
self.decimation = 4 # env step every 4 sim steps: 200Hz / 4 = 50Hz
# simulation settings
self.sim.dt = 0.005 # sim step every 5ms: 200Hz
self.sim.physics_manager_cfg.dt = 0.005 # sim step every 5ms: 200Hz


def main():
Expand Down
2 changes: 1 addition & 1 deletion scripts/tutorials/03_envs/create_cube_base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def __post_init__(self):
# general settings
self.decimation = 2
# simulation settings
self.sim.dt = 0.01
self.sim.physics_manager_cfg.dt = 0.01
self.sim.physics_material = self.scene.terrain.physics_material
self.sim.render_interval = 2 # render interval should be a multiple of decimation
self.sim.device = args_cli.device
Expand Down
4 changes: 2 additions & 2 deletions scripts/tutorials/03_envs/create_quadruped_base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ def __post_init__(self):
# general settings
self.decimation = 4 # env decimation -> 50 Hz control
# simulation settings
self.sim.dt = 0.005 # simulation timestep -> 200 Hz physics
self.sim.physics_manager_cfg.dt = 0.005 # simulation timestep -> 200 Hz physics
self.sim.physics_material = self.scene.terrain.physics_material
self.sim.device = args_cli.device
# update sensor update periods
# we tick all the sensors based on the smallest update period (physics update period)
if self.scene.height_scanner is not None:
self.scene.height_scanner.update_period = self.decimation * self.sim.dt # 50 Hz
self.scene.height_scanner.update_period = self.decimation * self.sim.physics_manager_cfg.dt # 50 Hz


def main():
Expand Down
2 changes: 1 addition & 1 deletion scripts/tutorials/03_envs/policy_inference_in_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def main():
)
env_cfg.sim.device = args_cli.device
if args_cli.device == "cpu":
env_cfg.sim.use_fabric = False
env_cfg.sim.physics_manager_cfg.use_fabric = False

# create environment
env = ManagerBasedRLEnv(cfg=env_cfg)
Expand Down
4 changes: 2 additions & 2 deletions scripts/tutorials/04_sensors/run_usd_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def run_simulator(sim: sim_utils.SimulationContext, scene_entities: dict):
camera_index = args_cli.camera_id

# Create the markers for the --draw option outside of is_running() loop
if sim.has_gui() and args_cli.draw:
if sim.carb_settings.get("/isaaclab/has_gui") and args_cli.draw:
cfg = RAY_CASTER_MARKER_CFG.replace(prim_path="/Visuals/CameraPointCloud")
cfg.markers["hit"].radius = 0.002
pc_markers = VisualizationMarkers(cfg)
Expand Down Expand Up @@ -247,7 +247,7 @@ def run_simulator(sim: sim_utils.SimulationContext, scene_entities: dict):
rep_writer.write(rep_output)

# Draw pointcloud if there is a GUI and --draw has been passed
if sim.has_gui() and args_cli.draw and "distance_to_image_plane" in camera.data.output.keys():
if sim.carb_settings.get("/isaaclab/has_gui") and args_cli.draw and "distance_to_image_plane" in camera.data.output.keys():
# Derive pointcloud from camera at camera_index
pointcloud = create_pointcloud_from_depth(
intrinsic_matrix=camera.data.intrinsic_matrices[camera_index],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from typing import TYPE_CHECKING

import omni.physics.tensors.impl.api as physx
from isaacsim.core.simulation_manager import SimulationManager
from isaaclab.physics.physx_manager import PhysxManager
from pxr import PhysxSchema, UsdPhysics

import isaaclab.sim as sim_utils
Expand Down Expand Up @@ -1475,7 +1475,7 @@ def write_spatial_tendon_properties_to_sim(

def _initialize_impl(self):
# obtain global simulation view
self._physics_sim_view = SimulationManager.get_physics_sim_view()
self._physics_sim_view = PhysxManager.get_physics_sim_view()

if self.cfg.articulation_root_prim_path is not None:
# The articulation root prim path is specified explicitly, so we can just use this.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import weakref

import omni.physics.tensors.impl.api as physx
from isaacsim.core.simulation_manager import SimulationManager
from isaaclab.physics.physx_manager import PhysxManager

import isaaclab.utils.math as math_utils
from isaaclab.utils.buffers import TimestampedBuffer
Expand Down Expand Up @@ -53,7 +53,7 @@ def __init__(self, root_physx_view: physx.ArticulationView, device: str):
self._sim_timestamp = 0.0

# obtain global simulation view
self._physics_sim_view = SimulationManager.get_physics_sim_view()
self._physics_sim_view = PhysxManager.get_physics_sim_view()
gravity = self._physics_sim_view.get_gravity()
# Convert to direction vector
gravity_dir = torch.tensor((gravity[0], gravity[1], gravity[2]), device=self.device)
Expand Down
34 changes: 21 additions & 13 deletions source/isaaclab/isaaclab/assets/asset_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Copy link
Collaborator

Choose a reason for hiding this comment

The 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,
)
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from typing import TYPE_CHECKING

import omni.physics.tensors.impl.api as physx
from isaacsim.core.simulation_manager import SimulationManager
from isaaclab.physics.physx_manager import PhysxManager
from pxr import PhysxSchema, UsdShade

import isaaclab.sim as sim_utils
Expand Down Expand Up @@ -266,7 +266,7 @@ def transform_nodal_pos(

def _initialize_impl(self):
# obtain global simulation view
self._physics_sim_view = SimulationManager.get_physics_sim_view()
self._physics_sim_view = PhysxManager.get_physics_sim_view()
# obtain the first prim in the regex expression (all others are assumed to be a copy of this)
template_prim = sim_utils.find_first_matching_prim(self.cfg.prim_path)
if template_prim is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from typing import TYPE_CHECKING

import omni.physics.tensors.impl.api as physx
from isaacsim.core.simulation_manager import SimulationManager
from isaaclab.physics.physx_manager import PhysxManager
from pxr import UsdPhysics

import isaaclab.sim as sim_utils
Expand Down Expand Up @@ -458,7 +458,7 @@ def set_external_force_and_torque(

def _initialize_impl(self):
# obtain global simulation view
self._physics_sim_view = SimulationManager.get_physics_sim_view()
self._physics_sim_view = PhysxManager.get_physics_sim_view()
# obtain the first prim in the regex expression (all others are assumed to be a copy of this)
template_prim = sim_utils.find_first_matching_prim(self.cfg.prim_path)
if template_prim is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import TYPE_CHECKING

import omni.physics.tensors.impl.api as physx
from isaacsim.core.simulation_manager import SimulationManager
from isaaclab.physics.physx_manager import PhysxManager
from pxr import UsdPhysics

import isaaclab.sim as sim_utils
Expand Down Expand Up @@ -594,7 +594,7 @@ def _initialize_impl(self):
# clear object names list to prevent double counting on re-initialization
self._object_names_list.clear()
# obtain global simulation view
self._physics_sim_view = SimulationManager.get_physics_sim_view()
self._physics_sim_view = PhysxManager.get_physics_sim_view()
root_prim_path_exprs = []
for name, rigid_object_cfg in self.cfg.rigid_objects.items():
# obtain the first prim in the regex expression (all others are assumed to be a copy of this)
Expand Down Expand Up @@ -737,15 +737,16 @@ def _invalidate_initialize_callback(self, event):
# set all existing views to None to invalidate them
self._root_physx_view = 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
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/controllers/rmp_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import torch
from dataclasses import MISSING

from isaacsim.core.api.simulation_context import SimulationContext
from isaaclab.sim import SimulationContext
from isaacsim.core.prims import SingleArticulation

# enable motion generation extensions
Expand Down
Loading