Fix Newton USD import dropping mjc joint attributes - #7386
Fix Newton USD import dropping mjc joint attributes#7386AntoineRichard wants to merge 2 commits into
Conversation
Greptile SummaryThe PR consistently adds the MuJoCo USD schema resolver to Newton's main import, replication, visualization, and articulation-ordering paths so authored
Confidence Score: 4/5The implementation appears safe to merge, with one non-blocking test-portability issue caused by fixing the regression test to cuda:0. The resolver lists remain aligned across the relevant Newton builder paths and the new regression covers the intended import behavior; only the test's hard-coded device can make it fail on otherwise supported test hosts or shards. Files Needing Attention: source/isaaclab_newton/test/sim/test_mjc_usd_import.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[USD stage with mjc attributes] --> B[Newton / PhysX / MJC schema resolvers]
B --> C[Newton ModelBuilder]
C --> D[Cloned simulation worlds]
C --> E[Visualization builder]
C --> F[Articulation ordering emulation]
C --> G[Final Newton model joint friction]
Reviews (1): Last reviewed commit: "Fix Newton USD import dropping mjc joint..." | Re-trigger Greptile |
| """A USD joint authored with ``mjc:frictionloss`` yields a matching ``joint_friction``.""" | ||
| sim_cfg = SimulationCfg( | ||
| dt=0.005, | ||
| device="cuda:0", |
There was a problem hiding this comment.
The regression test bypasses the repository's ISAACLAB_TEST_DEVICES-based selection by fixing SimulationCfg.device to cuda:0. On a CPU-only host or a shard assigned another GPU, initialization fails independently of the resolver behavior; please parameterize this through the existing test-device utility.
There was a problem hiding this comment.
Isaac Lab Review Bot
The change appends SchemaResolverMjc to the Newton USD import paths used by stage loading, clone replication, visualization building, and articulation-ordering emulation, with a focused mjc:frictionloss regression test and package changelog fragments.
- Design and architecture: The resolver ordering remains consistent across the four affected producer paths, preserving the documented lockstep relationship between live Newton imports and MJWarp ordering emulation. Existing joint and body ordering settings are unchanged.
- API: No public signatures, defaults, exports, or return types change. The behavioral compatibility surface is limited to retaining USD-authored
mjc:*attributes that were previously dropped during Newton import. - Implementation: The resolver list is updated wherever the relevant builders call
add_usd, and the ordering-resolver mock is extended accordingly. The regression test exercises the manager import throughModel.joint_friction; its explicitcuda:0device remains a non-blocking portability tradeoff for CPU-only test environments.
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.
|
run-ci |
hujc7
left a comment
There was a problem hiding this comment.
This might have wider effect as previously dropped attributes are now read in newton?
|
i think it is better to patch mjc schema only for mjwarp manager? |
|
my agent also believes #7298 is a better fix. |
Description
Fixes #6829.
Joint Coulomb friction authored on a USD as
mjc:frictionlossnever reached the Newton solver: Isaac Lab'sadd_usdcalls passedschema_resolvers=[SchemaResolverNewton(), SchemaResolverPhysx()], somjc:*attributes were dropped andModel.joint_frictionstayed0.0even though the same asset loads correctly through Newton core's Mjc resolver.This adds
SchemaResolverMjcto the schema-resolver list on the two paths that build the live physics model:isaaclab_newton/physics/newton_manager.py(main stage import)isaaclab_newton/cloner/replicate.py(clone-plan build path)The visualization builder and the core ordering-resolver emulation are deliberately left untouched: schema resolvers only control which attributes are parsed, so they cannot affect rendering or joint ordering, and keeping them out makes the change minimal.
Safety:
SchemaResolverMjcpopulates the coreModel.joint_frictionfield and is a no-op-safe addition when a solver has not registered MuJoCo custom attributes (verified with a no-registration import), so the change is unconditional rather than MJWarp-gated.Adds a kitless regression test in
test_newton_manager_abstraction.pythat authors a revolute joint withmjc:frictionloss=0.11and asserts the value reachesModel.joint_frictionthroughNewtonManager.instantiate_builder_from_stage()— it fails without this change and passes with it.Type of change
Testing
test_newton_manager_abstraction.py::test_usd_mjc_frictionloss_reaches_newton_model— new regression (fails ondevelop, passes here); full file 162 passedsource/isaaclab/test/assets/test_articulation_ordering.py— 63 passed (untouched by this PR)Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there