Skip to content

Commit 33e6865

Browse files
authored
Fixes deprecation warning for pxr.Semantics (#2721)
# Description pxr.Semantics was deprecated in Isaac Sim 4.2 and is now Semantics. This PR replaces imports of pxr.Semantics with Semantics if available. ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task -->
1 parent ca4043c commit 33e6865

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@
1111
import isaacsim.core.utils.stage as stage_utils
1212
import omni.kit.commands
1313
import omni.log
14-
from pxr import Gf, Sdf, Semantics, Usd
14+
from pxr import Gf, Sdf, Usd
15+
16+
# from Isaac Sim 4.2 onwards, pxr.Semantics is deprecated
17+
try:
18+
import Semantics
19+
except ModuleNotFoundError:
20+
from pxr import Semantics
1521

1622
from isaaclab.sim import converters, schemas
1723
from isaaclab.sim.utils import bind_physics_material, bind_visual_material, clone, select_usd_variants

source/isaaclab/test/sensors/test_tiled_camera.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525
import omni.replicator.core as rep
2626
import pytest
2727
from isaacsim.core.prims import SingleGeometryPrim, SingleRigidPrim
28-
from pxr import Gf, Semantics, UsdGeom
28+
from pxr import Gf, UsdGeom
29+
30+
# from Isaac Sim 4.2 onwards, pxr.Semantics is deprecated
31+
try:
32+
import Semantics
33+
except ModuleNotFoundError:
34+
from pxr import Semantics
2935

3036
import isaaclab.sim as sim_utils
3137
from isaaclab.sensors.camera import Camera, CameraCfg, TiledCamera, TiledCameraCfg

0 commit comments

Comments
 (0)