Skip to content

Commit 2c411d4

Browse files
kellyguo11isaaclab-bot[bot]
authored andcommitted
Avoid duplicate MuJoCo schema registration (#7393)
# Description Isaac Lab exposes the codeless `mjcPhysics` plugin through `PXR_PLUGINPATH_NAME` before OpenUSD builds its schema registry. The Kit experiences also enabled `omni.usd.schema.mujoco`, which bundles a second plugin with the same name and reports the duplicate registration as an error even though the schema is already available. This change removes the redundant extension dependency from the GUI and headless Kit experiences. It keeps the early Isaac Lab schema exposure needed by kitless MJCF conversion and documents why Kit must not register a second copy. No Kit extension replaces `omni.usd.schema.mujoco`: importing `isaaclab` adds the standalone `mujoco_usd_converter/plugins` directory to `PXR_PLUGINPATH_NAME`, and the OpenUSD `Plug.Registry` discovers its codeless schema metadata. This is the same mechanism in Kit and kitless processes. No new dependencies are required. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Screenshots Not applicable; this removes a startup log error. ## Validation - Live `isaaclab.python.kit` experience: launched successfully with `headless=True`; `MjcSceneAPI` and the `mjcPhysics` plugin were available, `omni.usd.schema.mujoco` remained disabled, and the duplicate-registration error had zero matches - Fresh kitless probe: `AppLauncher.is_available()` was false while `MjcSceneAPI` and `mjcPhysics` were available from the standalone converter plugin directory - Existing kitless MJCF converter suite: 12 passed - Existing experience-file tests: 6 passed - Changelog validation against `upstream/develop`: passed - Full repository formatting and pre-commit gate: passed No new regression test was added, as requested. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks - [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 - [x] I have added a changelog fragment under `source/isaaclab/changelog.d/` - [x] My name already exists in `CONTRIBUTORS.md` (cherry picked from commit 493e3e3)
1 parent adf8d9c commit 2c411d4

5 files changed

Lines changed: 55 additions & 7 deletions

File tree

apps/isaaclab.python.headless.kit

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ enabled=true # Enable this for DLSS
198198
########################
199199
[dependencies]
200200
"isaacsim.core.version" = {}
201-
# USD schema plugins must load before the schema registry is first accessed.
202-
"omni.usd.schema.mujoco" = {}
203201

204202
# Asset path
205203
# set the S3 directory manually to the latest published S3

apps/isaaclab.python.kit

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ keywords = ["experience", "app", "usd"]
1616
"isaacsim.gui.components" = {}
1717
"isaacsim.simulation_app" = {}
1818
"isaacsim.storage.native" = {}
19-
# USD schema plugins must load before the schema registry is first accessed.
20-
"omni.usd.schema.mujoco" = {}
2119

2220
# Kit based editor extensions
2321
"omni.anim.curve.core" = {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Fixed
2+
^^^^^
3+
4+
* Fixed duplicate ``mjcPhysics`` schema registration during Kit visualizer startup while preserving
5+
schema discovery for both installed and source Isaac Sim runtimes.

source/isaaclab/isaaclab/__init__.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,29 @@ def _expose_mujoco_usd_schemas():
9393
OpenUSD reads the search path while building the registry, so this only helps while the
9494
registry is still unbuilt. A host that queries a schema before importing Isaac Lab has to put
9595
the plugin directory on ``PXR_PLUGINPATH_NAME`` itself.
96+
97+
Isaac Lab's Kit experiences must not also enable ``omni.usd.schema.mujoco``. The extension
98+
bundles a second plugin with the same name and reports its duplicate registration as an error.
9699
"""
100+
plugins = None
97101
spec = importlib.util.find_spec("mujoco_usd_converter")
98-
if spec is None or spec.origin is None:
99-
return
100-
plugins = os.path.join(os.path.dirname(spec.origin), "plugins")
102+
if spec is not None and spec.origin is not None:
103+
plugins = os.path.join(os.path.dirname(spec.origin), "plugins")
104+
105+
# Source Isaac Sim exposes this prebundle only after Kit starts, which is too late for the
106+
# schema registry. Its root is available earlier through the launcher environment.
107+
if plugins is None or not os.path.isdir(plugins):
108+
isaac_path = os.environ.get("ISAAC_PATH")
109+
if isaac_path is None:
110+
return
111+
plugins = os.path.join(
112+
isaac_path,
113+
"exts",
114+
"isaacsim.pip.newton",
115+
"pip_prebundle",
116+
"mujoco_usd_converter",
117+
"plugins",
118+
)
101119
if not os.path.isdir(plugins):
102120
return
103121
search_path = os.environ.get("PXR_PLUGINPATH_NAME", "")

tools/wheel_builder/res/__init__.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,36 @@ def _should_demote(path: str) -> bool:
8484
os.environ["PYTHONPATH"] = os.pathsep.join(env_clean + env_demoted)
8585

8686

87+
def _expose_mujoco_usd_schemas():
88+
"""Put the MuJoCo USD schemas on OpenUSD's plugin search path."""
89+
plugins = None
90+
spec = find_spec("mujoco_usd_converter")
91+
if spec is not None and spec.origin is not None:
92+
plugins = os.path.join(os.path.dirname(spec.origin), "plugins")
93+
94+
# Source Isaac Sim exposes this prebundle only after Kit starts, which is too late for the
95+
# schema registry. Its root is available earlier through the launcher environment.
96+
if plugins is None or not os.path.isdir(plugins):
97+
isaac_path = os.environ.get("ISAAC_PATH")
98+
if isaac_path is None:
99+
return
100+
plugins = os.path.join(
101+
isaac_path,
102+
"exts",
103+
"isaacsim.pip.newton",
104+
"pip_prebundle",
105+
"mujoco_usd_converter",
106+
"plugins",
107+
)
108+
if not os.path.isdir(plugins):
109+
return
110+
search_path = os.environ.get("PXR_PLUGINPATH_NAME", "")
111+
if plugins not in search_path.split(os.pathsep):
112+
os.environ["PXR_PLUGINPATH_NAME"] = os.pathsep.join(filter(None, (search_path, plugins)))
113+
114+
87115
_deprioritize_prebundle_paths()
116+
_expose_mujoco_usd_schemas()
88117

89118

90119
# TODO(myurasov-nv): bootstrap_kernel() is ported from the internal GitLab wheel builder

0 commit comments

Comments
 (0)