Skip to content

Fix MJWarp USD friction loss import - #7298

Open
NeoZng wants to merge 2 commits into
isaac-sim:developfrom
NeoZng:neozng/fix-mjwarp-usd-joint-properties
Open

Fix MJWarp USD friction loss import#7298
NeoZng wants to merge 2 commits into
isaac-sim:developfrom
NeoZng:neozng/fix-mjwarp-usd-joint-properties

Conversation

@NeoZng

@NeoZng NeoZng commented Aug 22, 2026

Copy link
Copy Markdown

Description

Preserve MuJoCo-authored joint friction loss when Isaac Lab imports USD stages
for the Newton MJWarp backend.

Before this change, the vectorized clone path and the standalone stage-import
path both passed only SchemaResolverNewton and SchemaResolverPhysx to
Newton. As a result, a joint authored with mjc:frictionloss=0.11 finalized
with Model.joint_friction=0.0, even though Newton supports that attribute
through SchemaResolverMjc.

This change:

  • lets the active Newton solver manager own the USD resolver list;
  • registers SolverMuJoCo custom attributes from NewtonMJWarpManager;
  • appends the full SchemaResolverMjc after the Newton and PhysX resolvers, so
    MuJoCo values remain fallbacks rather than overriding higher-priority schema
    values; and
  • uses the manager-owned resolver list in both clone replication and standalone
    stage import.

The production-path regression covers both imports. In each case,
mjc:frictionloss=0.11 now reaches Model.joint_friction, while
mjc:damping=0.23 continues to reach Model.joint_damping through the
existing MuJoCo custom-attribute path.

No new dependency or public API is introduced.

Addresses #6829.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Not applicable; this fixes a non-visual USD import path.

Verification

  • Matching isolated environment: Python 3.12.13,
    isaaclab-newton==5.4.0, newton==1.5.0, warp-lang==1.16.0, and
    mujoco-warp==3.11.0.
  • Focused production-path regression: 2 passed (clone and standalone).
  • Base-fail/fix-pass check:
    • removing the clone resolver wiring leaves clone-imported
      joint_friction=0.0 instead of 0.11;
    • removing the standalone resolver wiring leaves standalone-imported
      joint_friction=0.0 instead of 0.11.
  • Full Newton manager abstraction suite on a CUDA host: 157 passed.
  • uv run python tools/changelog/cli.py check develop --include-worktree.
  • uv run isaaclab -f.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab -f
  • I have made corresponding changes to the documentation (not applicable: no public API or user workflow changed)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Route Newton USD imports through solver-owned schema resolvers and register MuJoCo attributes for both clone and standalone paths.

Addresses isaac-sim#6829.

Signed-off-by: NeoZng <neozng@foxmail.com>
@NeoZng
NeoZng requested a review from a team August 22, 2026 10:27
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 22, 2026

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

The change centralizes USD schema-resolver selection in the active Newton manager and extends MJWarp imports with SchemaResolverMjc, preserving MuJoCo-authored joint friction and damping across clone-replication and standalone stage-import paths.

  • Design and architecture: The protected resolver hook follows the existing solver-manager extension pattern and keeps MJWarp-specific schema handling within NewtonMJWarpManager. Both import paths now consume the same manager-owned resolver ordering. Resolver precedence still depends on Newton's ordered resolver semantics, but the explicit Newton/PhysX/MuJoCo ordering is consistent with the intended fallback behavior.
  • API: No public API or dependency changes are introduced. The new protected classmethods use existing manager hooks, and MuJoCo custom-attribute registration is integrated through the established builder-registration mechanism. The package changelog fragment documents the user-visible fix.
  • Implementation: The resolver list is passed through the clone path to both the main builder and source builders, and through the standalone stage-import path. Non-MJWarp managers retain the prior Newton and PhysX resolver defaults. The focused regression test exercises both production import paths and verifies mjc:frictionloss and mjc:damping in the finalized model.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR preserves MuJoCo-authored joint friction loss during MJWarp USD imports by moving resolver selection behind the active Newton manager.

  • Adds MJWarp-specific custom-attribute registration and the MuJoCo schema resolver.
  • Uses manager-owned resolver lists in both clone and standalone stage-import paths.
  • Adds production-path regression coverage for friction loss and damping.
  • Adds a changelog fragment and contributor entry.

Confidence Score: 5/5

The PR appears safe to merge, with both affected USD import paths covered by focused regression tests.

The resolver hook is inherited by all reachable Newton managers, production clone dispatch occurs after manager initialization, and the MJWarp override preserves base behavior while adding the required MuJoCo import support.

Important Files Changed

Filename Overview
source/isaaclab_newton/isaaclab_newton/physics/mjwarp_manager.py Extends MJWarp builder setup with MuJoCo custom attributes and appends the MuJoCo USD resolver.
source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py Introduces a solver-overridable resolver-list hook and uses it for standalone stage import.
source/isaaclab_newton/isaaclab_newton/cloner/replicate.py Routes clone imports through the active Newton manager’s schema resolvers.
source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py Covers clone and standalone MJWarp imports and verifies MuJoCo friction-loss and damping values survive finalization.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    USD[USD stage with mjc attributes] --> Path{Import path}
    Path -->|Clone| Clone[Replication builder]
    Path -->|Standalone| Standalone[Stage builder]
    Clone --> Manager[Active Newton manager]
    Standalone --> Manager
    Manager --> Resolvers[Newton → PhysX → MuJoCo resolvers]
    Manager --> Attributes[SolverMuJoCo custom attributes]
    Resolvers --> Builder[Newton ModelBuilder]
    Attributes --> Builder
    Builder --> Model[Finalized MJWarp model]
Loading

Reviews (1): Last reviewed commit: "Fix MJWarp USD friction loss import" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant