Skip to content

Commit d9bdc7f

Browse files
vidurv-nvidiakellyguo11AntoineRichard
authored
Refactors the doc on Schema for Lab 3.0, and adds MuJoCo gravcomp (#5276)
# Description Adds Newton-native and MuJoCo-specific schema cfg classes to `isaaclab_newton.sim.schemas`, following the base/subclass framework from #5275. All new cfgs use the per-declaring-class MRO routing in `_apply_namespaced_schemas` — no backend-specific branching in any writer. Depends on #5275. ## New cfgs ### MuJoCo (Newton MuJoCo kernel, `mjc:*` namespace) | Class | Field | USD attribute | Applied schema | |---|---|---|---| | `MujocoRigidBodyPropertiesCfg` | `gravcomp` | `mjc:gravcomp` | None (raw attr) | | `MujocoJointDrivePropertiesCfg` | `actuatorgravcomp` | `mjc:actuatorgravcomp` | `MjcJointAPI` | Body-level `gravcomp` must be set for joint-level `actuatorgravcomp` to have any effect. The spawner auto-enables `MujocoRigidBodyPropertiesCfg(gravcomp=1.0)` when joint-level actuator gravcomp is requested without body-level gravcomp. ### Newton-native (`newton:*` namespace) | Class | Fields | USD attributes | Applied schema | |---|---|---|---| | `NewtonCollisionPropertiesCfg` | `contact_margin`, `contact_gap` | `newton:contactMargin`, `newton:contactGap` | `NewtonCollisionAPI` | | `NewtonMeshCollisionPropertiesCfg` | `max_hull_vertices` | `newton:maxHullVertices` | `NewtonMeshCollisionAPI` | | `NewtonMaterialPropertiesCfg` | `torsional_friction`, `rolling_friction` | `newton:torsionalFriction`, `newton:rollingFriction` | `NewtonMaterialAPI` | | `NewtonArticulationRootPropertiesCfg` | `self_collision_enabled` | `newton:selfCollisionEnabled` | `NewtonArticulationRootAPI` | ## Design constraints Same single-cfg-per-spawner-slot rule as #5275. Newton cfgs subclass the same base classes as PhysX cfgs; each declares `_usd_namespace`/`_usd_applied_schema` (ClassVar) and fields that auto-camelCase to their USD attr names. Per-declaring-class MRO routing handles mixed PhysX+Newton cfg hierarchies correctly. ## Field renames (with deprecation aliases through 5.0) | Old | New | Reason | |---|---|---| | `gravity_compensation_scale` | `gravcomp` | Single word identity: `gravcomp` → `mjc:gravcomp` | | `gravity_compensation` | `actuatorgravcomp` | Single word identity: `actuatorgravcomp` → `mjc:actuatorgravcomp` | ## Type of change - New feature (non-breaking) Forwarding shims on `isaaclab.sim.schemas` keep existing imports working. Deprecation aliases keep old field names working through 5.0. ## Test plan - [x] MuJoCo tests: `mjc:gravcomp` / `mjc:actuatorgravcomp` written when set, not written when None - [x] Newton collision, material, articulation-root: attrs written, schemas applied only when non-None - [x] Deprecation alias tests for renamed fields - [x] `test_schemas.py` 46/46 pass — no regressions - [x] Pre-commit clean ## Supersedes Together with #5275, supersedes #4847 and #5203. --------- Co-authored-by: Kelly Guo <kellyg@nvidia.com> Co-authored-by: Antoine RICHARD <antoiner@nvidia.com>
1 parent dd5a21a commit d9bdc7f

22 files changed

Lines changed: 1565 additions & 41 deletions

File tree

docs/source/api/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ The following modules are available in the ``isaaclab_newton`` extension:
161161
renderers
162162
scene_data_providers
163163
sensors
164+
sim.schemas
164165

165166
.. toctree::
166167
:hidden:
@@ -171,6 +172,7 @@ The following modules are available in the ``isaaclab_newton`` extension:
171172
lab_newton/isaaclab_newton.renderers
172173
lab_newton/isaaclab_newton.scene_data_providers
173174
lab_newton/isaaclab_newton.sensors
175+
lab_newton/isaaclab_newton.sim.schemas
174176

175177
isaaclab_ov extension
176178
---------------------

docs/source/api/lab/isaaclab.sim.schemas.rst

Lines changed: 80 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
1-
isaaclab.sim.schemas
1+
isaaclab.sim.schemas
22
====================
33

44
.. automodule:: isaaclab.sim.schemas
55

6-
.. rubric:: Classes
6+
.. rubric:: Solver-common base classes
7+
8+
These base classes carry the universal-physics fields that every backend honors.
9+
They live in core ``isaaclab`` and have no backend dependency. For backend-specific
10+
knobs, use the matching subclass in :mod:`isaaclab_physx.sim.schemas` or
11+
:mod:`isaaclab_newton.sim.schemas`. See :doc:`/source/overview/core-concepts/schema_cfgs`
12+
for the full design.
713

814
.. autosummary::
915

10-
ArticulationRootPropertiesCfg
11-
RigidBodyPropertiesCfg
12-
CollisionPropertiesCfg
16+
ArticulationRootBaseCfg
17+
RigidBodyBaseCfg
18+
CollisionBaseCfg
19+
JointDriveBaseCfg
20+
MeshCollisionBaseCfg
1321
MassPropertiesCfg
14-
JointDrivePropertiesCfg
15-
FixedTendonPropertiesCfg
22+
23+
.. rubric:: Mesh collision approximations (USD-only, no PhysX schema)
24+
25+
.. autosummary::
26+
27+
BoundingCubePropertiesCfg
28+
BoundingSpherePropertiesCfg
1629

1730
.. rubric:: Functions
1831

@@ -28,39 +41,60 @@
2841
define_mass_properties
2942
modify_mass_properties
3043
modify_joint_drive_properties
44+
define_mesh_collision_properties
45+
modify_mesh_collision_properties
3146
modify_fixed_tendon_properties
47+
modify_spatial_tendon_properties
48+
49+
.. currentmodule:: isaaclab.sim.schemas
3250

3351
Articulation Root
3452
-----------------
3553

36-
.. autoclass:: ArticulationRootPropertiesCfg
54+
.. autoclass:: ArticulationRootBaseCfg
3755
:members:
3856
:exclude-members: __init__
3957

4058
.. autofunction:: define_articulation_root_properties
4159
.. autofunction:: modify_articulation_root_properties
4260

61+
For PhysX-specific articulation properties (self-collisions, TGS solver iterations,
62+
sleep/stabilization thresholds), see
63+
:class:`~isaaclab_physx.sim.schemas.PhysxArticulationRootPropertiesCfg`. For
64+
Newton-native self-collisions, see
65+
:class:`~isaaclab_newton.sim.schemas.NewtonArticulationRootPropertiesCfg`.
66+
4367
Rigid Body
4468
----------
4569

46-
.. autoclass:: RigidBodyPropertiesCfg
70+
.. autoclass:: RigidBodyBaseCfg
4771
:members:
4872
:exclude-members: __init__
4973

5074
.. autofunction:: define_rigid_body_properties
5175
.. autofunction:: modify_rigid_body_properties
5276
.. autofunction:: activate_contact_sensors
5377

78+
For PhysX-specific rigid body properties (damping, max velocities, solver iterations,
79+
sleep/stabilization), see :class:`~isaaclab_physx.sim.schemas.PhysxRigidBodyPropertiesCfg`.
80+
For MuJoCo-specific gravity compensation, see
81+
:class:`~isaaclab_newton.sim.schemas.MujocoRigidBodyPropertiesCfg`.
82+
5483
Collision
5584
---------
5685

57-
.. autoclass:: CollisionPropertiesCfg
86+
.. autoclass:: CollisionBaseCfg
5887
:members:
5988
:exclude-members: __init__
6089

6190
.. autofunction:: define_collision_properties
6291
.. autofunction:: modify_collision_properties
6392

93+
For PhysX torsional patch friction, see
94+
:class:`~isaaclab_physx.sim.schemas.PhysxCollisionPropertiesCfg`. For Newton-native
95+
contact margin/gap, see
96+
:class:`~isaaclab_newton.sim.schemas.NewtonCollisionPropertiesCfg`.
97+
6498
Mass
6599
----
66100

@@ -74,20 +108,52 @@ Mass
74108
Joint Drive
75109
-----------
76110

77-
.. autoclass:: JointDrivePropertiesCfg
111+
.. autoclass:: JointDriveBaseCfg
78112
:members:
79113
:exclude-members: __init__
80114

81115
.. autofunction:: modify_joint_drive_properties
82116

83-
Fixed Tendon
84-
------------
117+
For PhysX-specific drive properties, see
118+
:class:`~isaaclab_physx.sim.schemas.PhysxJointDrivePropertiesCfg`. For MuJoCo
119+
actuator gravity compensation, see
120+
:class:`~isaaclab_newton.sim.schemas.MujocoJointDrivePropertiesCfg`.
121+
122+
Mesh Collision
123+
--------------
85124

86-
.. autoclass:: FixedTendonPropertiesCfg
125+
.. autoclass:: MeshCollisionBaseCfg
87126
:members:
88127
:exclude-members: __init__
89128

129+
.. autoclass:: BoundingCubePropertiesCfg
130+
:members:
131+
:show-inheritance:
132+
:exclude-members: __init__
133+
134+
.. autoclass:: BoundingSpherePropertiesCfg
135+
:members:
136+
:show-inheritance:
137+
:exclude-members: __init__
138+
139+
.. autofunction:: define_mesh_collision_properties
140+
.. autofunction:: modify_mesh_collision_properties
141+
142+
For PhysX cooking schemas (convex hull / decomposition / triangle mesh / SDF),
143+
see the ``Physx*PropertiesCfg`` family in :mod:`isaaclab_physx.sim.schemas`.
144+
For Newton hull-vertex limit, see
145+
:class:`~isaaclab_newton.sim.schemas.NewtonMeshCollisionPropertiesCfg`.
146+
147+
Tendon
148+
------
149+
90150
.. autofunction:: modify_fixed_tendon_properties
151+
.. autofunction:: modify_spatial_tendon_properties
152+
153+
Tendon cfg classes are PhysX-only and live in
154+
:mod:`isaaclab_physx.sim.schemas`
155+
(:class:`~isaaclab_physx.sim.schemas.PhysxFixedTendonPropertiesCfg`,
156+
:class:`~isaaclab_physx.sim.schemas.PhysxSpatialTendonPropertiesCfg`).
91157

92158
Deformable Body
93159
---------------
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
isaaclab_newton.sim.schemas
2+
===========================
3+
4+
.. automodule:: isaaclab_newton.sim.schemas
5+
6+
Newton-targeted schema configuration classes. Each cfg below extends a
7+
solver-common base in :mod:`isaaclab.sim.schemas` with Newton-namespaced
8+
attributes (``newton:*``) or solver-specific attributes (``mjc:*`` for
9+
Newton's MuJoCo solver). MuJoCo cfgs subclass their Newton counterpart
10+
because MuJoCo is one of Newton's solver options.
11+
12+
See :doc:`/source/overview/core-concepts/schema_cfgs` for the design and
13+
when to use each class.
14+
15+
.. rubric:: Newton-targeted (family roots)
16+
17+
.. autosummary::
18+
19+
NewtonRigidBodyPropertiesCfg
20+
NewtonJointDrivePropertiesCfg
21+
NewtonCollisionPropertiesCfg
22+
NewtonMeshCollisionPropertiesCfg
23+
NewtonMaterialPropertiesCfg
24+
NewtonArticulationRootPropertiesCfg
25+
26+
.. rubric:: MuJoCo-solver-specific
27+
28+
.. autosummary::
29+
30+
MujocoRigidBodyPropertiesCfg
31+
MujocoJointDrivePropertiesCfg
32+
33+
.. currentmodule:: isaaclab_newton.sim.schemas
34+
35+
Rigid Body
36+
----------
37+
38+
.. autoclass:: NewtonRigidBodyPropertiesCfg
39+
:members:
40+
:show-inheritance:
41+
:exclude-members: __init__
42+
43+
.. autoclass:: MujocoRigidBodyPropertiesCfg
44+
:members:
45+
:show-inheritance:
46+
:exclude-members: __init__
47+
48+
Joint Drive
49+
-----------
50+
51+
.. autoclass:: NewtonJointDrivePropertiesCfg
52+
:members:
53+
:show-inheritance:
54+
:exclude-members: __init__
55+
56+
.. autoclass:: MujocoJointDrivePropertiesCfg
57+
:members:
58+
:show-inheritance:
59+
:exclude-members: __init__
60+
61+
Collision
62+
---------
63+
64+
.. autoclass:: NewtonCollisionPropertiesCfg
65+
:members:
66+
:show-inheritance:
67+
:exclude-members: __init__
68+
69+
.. autoclass:: NewtonMeshCollisionPropertiesCfg
70+
:members:
71+
:show-inheritance:
72+
:exclude-members: __init__
73+
74+
Material
75+
--------
76+
77+
.. autoclass:: NewtonMaterialPropertiesCfg
78+
:members:
79+
:show-inheritance:
80+
:exclude-members: __init__
81+
82+
Articulation Root
83+
-----------------
84+
85+
.. autoclass:: NewtonArticulationRootPropertiesCfg
86+
:members:
87+
:show-inheritance:
88+
:exclude-members: __init__

docs/source/api/lab_physx/isaaclab_physx.sim.schemas.rst

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,49 @@ isaaclab_physx.sim.schemas
33

44
.. automodule:: isaaclab_physx.sim.schemas
55

6-
.. rubric:: Classes
6+
PhysX-specific schema configuration classes. Each cfg below extends a
7+
solver-common base in :mod:`isaaclab.sim.schemas` with PhysX-namespaced
8+
attributes (``physx*:*``) and applies the corresponding ``Physx*API``
9+
applied schema. See :doc:`/source/overview/core-concepts/schema_cfgs`
10+
for the design.
11+
12+
.. rubric:: Rigid body and joint drive
13+
14+
.. autosummary::
15+
16+
PhysxRigidBodyPropertiesCfg
17+
PhysxJointDrivePropertiesCfg
18+
19+
.. rubric:: Collision
20+
21+
.. autosummary::
22+
23+
PhysxCollisionPropertiesCfg
24+
25+
.. rubric:: Articulation root
26+
27+
.. autosummary::
28+
29+
PhysxArticulationRootPropertiesCfg
30+
31+
.. rubric:: Mesh collision (PhysX cooking)
32+
33+
.. autosummary::
34+
35+
PhysxConvexHullPropertiesCfg
36+
PhysxConvexDecompositionPropertiesCfg
37+
PhysxTriangleMeshPropertiesCfg
38+
PhysxTriangleMeshSimplificationPropertiesCfg
39+
PhysxSDFMeshPropertiesCfg
40+
41+
.. rubric:: Tendon
42+
43+
.. autosummary::
44+
45+
PhysxFixedTendonPropertiesCfg
46+
PhysxSpatialTendonPropertiesCfg
47+
48+
.. rubric:: Deformable body
749

850
.. autosummary::
951

@@ -18,6 +60,79 @@ isaaclab_physx.sim.schemas
1860

1961
.. currentmodule:: isaaclab_physx.sim.schemas
2062

63+
Rigid Body
64+
----------
65+
66+
.. autoclass:: PhysxRigidBodyPropertiesCfg
67+
:members:
68+
:show-inheritance:
69+
:exclude-members: __init__
70+
71+
Joint Drive
72+
-----------
73+
74+
.. autoclass:: PhysxJointDrivePropertiesCfg
75+
:members:
76+
:show-inheritance:
77+
:exclude-members: __init__
78+
79+
Collision
80+
---------
81+
82+
.. autoclass:: PhysxCollisionPropertiesCfg
83+
:members:
84+
:show-inheritance:
85+
:exclude-members: __init__
86+
87+
Articulation Root
88+
-----------------
89+
90+
.. autoclass:: PhysxArticulationRootPropertiesCfg
91+
:members:
92+
:show-inheritance:
93+
:exclude-members: __init__
94+
95+
Mesh Collision (PhysX cooking)
96+
-------------------------------
97+
98+
.. autoclass:: PhysxConvexHullPropertiesCfg
99+
:members:
100+
:show-inheritance:
101+
:exclude-members: __init__
102+
103+
.. autoclass:: PhysxConvexDecompositionPropertiesCfg
104+
:members:
105+
:show-inheritance:
106+
:exclude-members: __init__
107+
108+
.. autoclass:: PhysxTriangleMeshPropertiesCfg
109+
:members:
110+
:show-inheritance:
111+
:exclude-members: __init__
112+
113+
.. autoclass:: PhysxTriangleMeshSimplificationPropertiesCfg
114+
:members:
115+
:show-inheritance:
116+
:exclude-members: __init__
117+
118+
.. autoclass:: PhysxSDFMeshPropertiesCfg
119+
:members:
120+
:show-inheritance:
121+
:exclude-members: __init__
122+
123+
Tendon
124+
------
125+
126+
.. autoclass:: PhysxFixedTendonPropertiesCfg
127+
:members:
128+
:show-inheritance:
129+
:exclude-members: __init__
130+
131+
.. autoclass:: PhysxSpatialTendonPropertiesCfg
132+
:members:
133+
:show-inheritance:
134+
:exclude-members: __init__
135+
21136
Deformable Body
22137
---------------
23138

0 commit comments

Comments
 (0)