Unverified Commit 33e68659 authored by Kelly Guo's avatar Kelly Guo Committed by GitHub

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
-->
parent ca4043cc
......@@ -11,7 +11,13 @@ import isaacsim.core.utils.prims as prim_utils
import isaacsim.core.utils.stage as stage_utils
import omni.kit.commands
import omni.log
from pxr import Gf, Sdf, Semantics, Usd
from pxr import Gf, Sdf, Usd
# from Isaac Sim 4.2 onwards, pxr.Semantics is deprecated
try:
import Semantics
except ModuleNotFoundError:
from pxr import Semantics
from isaaclab.sim import converters, schemas
from isaaclab.sim.utils import bind_physics_material, bind_visual_material, clone, select_usd_variants
......
......@@ -25,7 +25,13 @@ import isaacsim.core.utils.stage as stage_utils
import omni.replicator.core as rep
import pytest
from isaacsim.core.prims import SingleGeometryPrim, SingleRigidPrim
from pxr import Gf, Semantics, UsdGeom
from pxr import Gf, UsdGeom
# from Isaac Sim 4.2 onwards, pxr.Semantics is deprecated
try:
import Semantics
except ModuleNotFoundError:
from pxr import Semantics
import isaaclab.sim as sim_utils
from isaaclab.sensors.camera import Camera, CameraCfg, TiledCamera, TiledCameraCfg
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment