Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test-only kitless interface cleanup for ovphysx bootstrap changes.
22 changes: 7 additions & 15 deletions source/isaaclab/test/assets/test_articulation_iface.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,17 @@
import sys
from unittest.mock import MagicMock

# When running kitless (e.g., ovphysx backend via run_ovphysx.sh), AppLauncher
# will try to boot Kit and hang. Skip it entirely: run_ovphysx.sh sets
# LD_PRELOAD to the ovphysx libcarb.so, which is the signature of a kitless
# ovphysx run. Also guard the case where neither LD_PRELOAD nor EXP_PATH is
# set (bare Python, no Kit at all).
_kitless = "ovphysx" in os.environ.get("LD_PRELOAD", "") or (
os.environ.get("LD_PRELOAD", "") == "" and "EXP_PATH" not in os.environ
)
# When running kitless, AppLauncher will try to boot Kit and hang. Skip it
# entirely when no Kit experience path is available.
_kitless = "EXP_PATH" not in os.environ

if not _kitless:
from isaaclab.app import AppLauncher

simulation_app = AppLauncher(headless=True).app
else:
simulation_app = None
# Stub out the Kit/Omniverse modules that are not present under
# run_ovphysx.sh (pxr, carb, omni, omni.kit[.app] are real on PYTHONPATH).
# Stub out the Omniverse modules that are not present under kitless test runs.
# ``omni`` is a real namespace package, so missing submodules also need
# to be installed as attributes on it -- ``sys.modules`` alone is not
# enough because attribute access on the real ``omni`` won't fall
Expand Down Expand Up @@ -65,10 +59,6 @@
_mock_physics_sim_view = MagicMock()
_mock_physics_sim_view.get_gravity.return_value = (0.0, 0.0, -9.81)

from isaaclab_physx.physics import PhysxManager as SimulationManager

SimulationManager.get_physics_sim_view = MagicMock(return_value=_mock_physics_sim_view)

"""
Check which backends are available.
"""
Expand All @@ -78,8 +68,10 @@
try:
from isaaclab_physx.assets.articulation.articulation import Articulation as PhysXArticulation
from isaaclab_physx.assets.articulation.articulation_data import ArticulationData as PhysXArticulationData
from isaaclab_physx.physics import PhysxManager as PhysXSimulationManager
from isaaclab_physx.test.mock_interfaces.views import MockArticulationViewWarp as PhysXMockArticulationViewWarp

PhysXSimulationManager.get_physics_sim_view = MagicMock(return_value=_mock_physics_sim_view)
BACKENDS.append("physx")
except ImportError:
pass
Expand Down Expand Up @@ -152,7 +144,7 @@ def create_physx_articulation(
# We can't call the initialize method here, because we don't have a good mock for the actuators yet.
# We need to set the _data attribute manually.

# Create ArticulationData instance (SimulationManager already mocked at module level)
# Create ArticulationData instance (PhysX manager patched when the backend import succeeds).
data = PhysXArticulationData(mock_view, device)
object.__setattr__(articulation, "_data", data)

Expand Down
20 changes: 6 additions & 14 deletions source/isaaclab/test/assets/test_rigid_object_collection_iface.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,17 @@
import sys
from unittest.mock import MagicMock

# When running kitless (e.g., ovphysx backend via run_ovphysx.sh), AppLauncher
# will try to boot Kit and hang. Skip it entirely: run_ovphysx.sh sets
# LD_PRELOAD to the ovphysx libcarb.so, which is the signature of a kitless
# ovphysx run. Also guard the case where neither LD_PRELOAD nor EXP_PATH is
# set (bare Python, no Kit at all).
_kitless = "ovphysx" in os.environ.get("LD_PRELOAD", "") or (
os.environ.get("LD_PRELOAD", "") == "" and "EXP_PATH" not in os.environ
)
# When running kitless, AppLauncher will try to boot Kit and hang. Skip it
# entirely when no Kit experience path is available.
_kitless = "EXP_PATH" not in os.environ

if not _kitless:
from isaaclab.app import AppLauncher

simulation_app = AppLauncher(headless=True).app
else:
simulation_app = None
# Stub out the Kit/Omniverse modules that are not present under
# run_ovphysx.sh (pxr, carb, omni, omni.kit[.app] are real on PYTHONPATH).
# Stub out the Omniverse modules that are not present under kitless test runs.
# ``omni`` is a real namespace package, so missing submodules also need
# to be installed as attributes on it -- ``sys.modules`` alone is not
# enough because attribute access on the real ``omni`` won't fall
Expand Down Expand Up @@ -64,10 +58,6 @@
_mock_physics_sim_view = MagicMock()
_mock_physics_sim_view.get_gravity.return_value = (0.0, 0.0, -9.81)

from isaaclab_physx.physics import PhysxManager as SimulationManager

SimulationManager.get_physics_sim_view = MagicMock(return_value=_mock_physics_sim_view)

"""
Check which backends are available.
"""
Expand All @@ -81,8 +71,10 @@
from isaaclab_physx.assets.rigid_object_collection.rigid_object_collection_data import (
RigidObjectCollectionData as PhysXRigidObjectCollectionData,
)
from isaaclab_physx.physics import PhysxManager as PhysXSimulationManager
from isaaclab_physx.test.mock_interfaces.views import MockRigidBodyViewWarp as PhysXMockRigidBodyViewWarp

PhysXSimulationManager.get_physics_sim_view = MagicMock(return_value=_mock_physics_sim_view)
BACKENDS.append("physx")
except ImportError:
pass
Expand Down
22 changes: 7 additions & 15 deletions source/isaaclab/test/assets/test_rigid_object_iface.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,17 @@
import sys
from unittest.mock import MagicMock

# When running kitless (e.g., ovphysx backend via run_ovphysx.sh), AppLauncher
# will try to boot Kit and hang. Skip it entirely: run_ovphysx.sh sets
# LD_PRELOAD to the ovphysx libcarb.so, which is the signature of a kitless
# ovphysx run. Also guard the case where neither LD_PRELOAD nor EXP_PATH is
# set (bare Python, no Kit at all).
_kitless = "ovphysx" in os.environ.get("LD_PRELOAD", "") or (
os.environ.get("LD_PRELOAD", "") == "" and "EXP_PATH" not in os.environ
)
# When running kitless, AppLauncher will try to boot Kit and hang. Skip it
# entirely when no Kit experience path is available.
_kitless = "EXP_PATH" not in os.environ

if not _kitless:
from isaaclab.app import AppLauncher

simulation_app = AppLauncher(headless=True).app
else:
simulation_app = None
# Stub out the Kit/Omniverse modules that are not present under
# run_ovphysx.sh (pxr, carb, omni, omni.kit[.app] are real on PYTHONPATH).
# Stub out the Omniverse modules that are not present under kitless test runs.
# ``omni`` is a real namespace package, so missing submodules also need
# to be installed as attributes on it -- ``sys.modules`` alone is not
# enough because attribute access on the real ``omni`` won't fall
Expand Down Expand Up @@ -64,10 +58,6 @@
_mock_physics_sim_view = MagicMock()
_mock_physics_sim_view.get_gravity.return_value = (0.0, 0.0, -9.81)

from isaaclab_physx.physics import PhysxManager as SimulationManager

SimulationManager.get_physics_sim_view = MagicMock(return_value=_mock_physics_sim_view)

"""
Check which backends are available.
"""
Expand All @@ -77,8 +67,10 @@
try:
from isaaclab_physx.assets.rigid_object.rigid_object import RigidObject as PhysXRigidObject
from isaaclab_physx.assets.rigid_object.rigid_object_data import RigidObjectData as PhysXRigidObjectData
from isaaclab_physx.physics import PhysxManager as PhysXSimulationManager
from isaaclab_physx.test.mock_interfaces.views import MockRigidBodyViewWarp as PhysXMockRigidBodyViewWarp

PhysXSimulationManager.get_physics_sim_view = MagicMock(return_value=_mock_physics_sim_view)
BACKENDS.append("physx")
except ImportError:
pass
Expand Down Expand Up @@ -124,7 +116,7 @@ def create_physx_rigid_object(
object.__setattr__(rigid_object, "_root_view", mock_view)
object.__setattr__(rigid_object, "_device", device)

# Create RigidObjectData instance (SimulationManager already mocked at module level)
# Create RigidObjectData instance (PhysX manager patched when the backend import succeeds).
data = PhysXRigidObjectData(mock_view, device)
object.__setattr__(rigid_object, "_data", data)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Changed
^^^^^^^

* Changed :mod:`isaaclab_ovphysx` to require the ovphysx 0.5 runtime line and
use its namespaced USD and static-Carbonite lifecycle directly. Users should
install ``ovphysx>=0.5,<0.6`` instead of ``ovphysx==0.4.13``.

Removed
^^^^^^^

* Removed the OVPhysX manager's temporary host ``pxr`` hiding, forced
process-exit shutdown hook, and wrapper-specific kitless test assumptions.
Run OVPhysX tests through ``./isaaclab.sh -p -m pytest``.
Loading
Loading