diff --git a/docs/source/migration/migrating_to_isaaclab_3-0.rst b/docs/source/migration/migrating_to_isaaclab_3-0.rst index 8b3a5683a900..2c235b5707ea 100644 --- a/docs/source/migration/migrating_to_isaaclab_3-0.rst +++ b/docs/source/migration/migrating_to_isaaclab_3-0.rst @@ -265,8 +265,16 @@ For the full design, see :ref:`schema-cfgs`. **Class moves and renames** +.. important:: + + The ``*BaseCfg`` / ``*PropertiesCfg`` classes in this subsection are themselves + now deprecated in favor of schema fragments, and will be removed in 3.2. Read + this subsection to understand where a 2.x name went, then migrate to the + fragments as described in :ref:`schema fragments `. The code samples + below show the intermediate step, not the recommended end state. + The following 2.x class names are kept as deprecated aliases. They forward to -the new location and will be removed in 3.1. +the new location and will be removed in 3.2. .. list-table:: :header-rows: 1 @@ -301,7 +309,7 @@ the new location and will be removed in 3.1. **Code migration** Existing 2.x code continues to work via the deprecation aliases (with a -``DeprecationWarning``; removed in 3.1): +``DeprecationWarning``; removed in 3.2): .. code-block:: python @@ -350,7 +358,7 @@ scheduled for removal in 4.0. - :attr:`~isaaclab.sim.schemas.JointDriveBaseCfg.max_force` - ``drive::physics:maxForce`` -Isaac Lab 2.x style still works (emits ``DeprecationWarning``; removed in 3.1): +Isaac Lab 2.x style still works (emits ``DeprecationWarning``; removed in 3.2): .. code-block:: python @@ -398,6 +406,224 @@ available under :mod:`isaaclab_newton.sim.schemas`: The MuJoCo cfgs subclass their Newton parent because MuJoCo is one of Newton's solver options. +.. _schema-fragments-migration: + +**Schema fragments supersede the whole** ``*PropertiesCfg`` / ``*BaseCfg`` **layer** + +The split above kept the inheritance-based shape of the 2.x cfgs: one class per +backend, each carrying fields from several USD namespaces. Isaac Lab now +replaces that layer with **schema fragments** — one ``@configclass`` per USD +applied schema, each writing exactly one attribute namespace. A spawner slot +takes a *list* of fragments, so you compose the namespaces you actually want +instead of picking a class that bundles them. + +Every class in the table below is deprecated: instantiating one emits a +``DeprecationWarning`` naming its replacement, and the class will be removed in +3.2. Nothing is removed in 3.0 — both APIs work side by side. + +The replacement column lists **every** fragment needed to cover the deprecated +class's fields, including the fields it inherits from a legacy base. A legacy +class usually bundles more than one USD namespace, so replacing it with only the +backend-specific fragment silently drops the inherited properties. + +.. list-table:: + :header-rows: 1 + :widths: 40 60 + + * - Deprecated class + - Fragment replacement (complete set) + * - ``MassPropertiesCfg`` + - :class:`~isaaclab.sim.schemas.MassCfg` + * - ``RigidBodyBaseCfg``, ``PhysxRigidBodyPropertiesCfg``, + ``RigidBodyPropertiesCfg``, ``NewtonRigidBodyPropertiesCfg`` + - :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg` + + :class:`~isaaclab_physx.sim.schemas.PhysxRigidBodyCfg` + * - ``MujocoRigidBodyPropertiesCfg`` + - :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg` + + :class:`~isaaclab_physx.sim.schemas.PhysxRigidBodyCfg` + + :class:`~isaaclab_newton.sim.schemas.MujocoRigidBodyCfg` + * - ``CollisionBaseCfg``, ``PhysxCollisionPropertiesCfg``, + ``CollisionPropertiesCfg`` + - :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` + + :class:`~isaaclab_physx.sim.schemas.PhysxCollisionCfg` + * - ``JointDriveBaseCfg``, ``PhysxJointDrivePropertiesCfg``, + ``JointDrivePropertiesCfg``, ``NewtonJointDrivePropertiesCfg`` + - :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` + + :class:`~isaaclab_physx.sim.schemas.PhysxJointCfg` + * - ``MujocoJointDrivePropertiesCfg`` + - :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` + + :class:`~isaaclab_physx.sim.schemas.PhysxJointCfg` + + :class:`~isaaclab_newton.sim.schemas.MujocoJointCfg` + * - ``ArticulationRootBaseCfg``, ``PhysxArticulationRootPropertiesCfg``, + ``ArticulationRootPropertiesCfg`` + - :class:`~isaaclab_physx.sim.schemas.PhysxArticulationCfg` + * - ``NewtonArticulationRootPropertiesCfg`` + - :class:`~isaaclab_physx.sim.schemas.PhysxArticulationCfg` + + :class:`~isaaclab_newton.sim.schemas.NewtonArticulationCfg` + * - ``MeshCollisionBaseCfg``, ``MeshCollisionPropertiesCfg``, + ``BoundingCubePropertiesCfg``, ``BoundingSpherePropertiesCfg`` + - :class:`~isaaclab.sim.schemas.UsdPhysicsMeshCollisionCfg` + * - ``Physx*MeshPropertiesCfg`` cooking family (``PhysxConvexHullPropertiesCfg``, + ``PhysxConvexDecompositionPropertiesCfg``, ``PhysxTriangleMeshPropertiesCfg``, + ``PhysxTriangleMeshSimplificationPropertiesCfg``, ``PhysxSDFMeshPropertiesCfg``) + - ``Physx*Cfg`` cooking fragments (:class:`~isaaclab_physx.sim.schemas.PhysxConvexHullCfg`, + :class:`~isaaclab_physx.sim.schemas.PhysxConvexDecompositionCfg`, + :class:`~isaaclab_physx.sim.schemas.PhysxTriangleMeshCfg`, + :class:`~isaaclab_physx.sim.schemas.PhysxTriangleMeshSimplificationCfg`, + :class:`~isaaclab_physx.sim.schemas.PhysxSDFMeshCfg`) + * - ``NewtonCollisionPropertiesCfg`` + - :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` + + :class:`~isaaclab_physx.sim.schemas.PhysxCollisionCfg` + + :class:`~isaaclab_newton.sim.schemas.NewtonCollisionCfg` + * - ``NewtonMeshCollisionPropertiesCfg`` + - :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` + + :class:`~isaaclab_physx.sim.schemas.PhysxCollisionCfg` + + :class:`~isaaclab_newton.sim.schemas.NewtonCollisionCfg` + + :class:`~isaaclab.sim.schemas.UsdPhysicsMeshCollisionCfg` + + :class:`~isaaclab_newton.sim.schemas.NewtonMeshCollisionCfg` + * - ``NewtonSDFCollisionPropertiesCfg`` + - :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` + + :class:`~isaaclab_physx.sim.schemas.PhysxCollisionCfg` + + :class:`~isaaclab_newton.sim.schemas.NewtonCollisionCfg` + + :class:`~isaaclab_newton.sim.schemas.NewtonSDFCollisionCfg` + +.. note:: + + PhysX fragments appear in the Newton rows because several universally honored + properties have no other USD home today: ``disable_gravity`` is only + ``physxRigidBody:disableGravity``, ``max_joint_velocity`` only + ``physxJoint:maxJointVelocity``, ``contact_offset`` / ``rest_offset`` only + ``physxCollision:*``, and ``articulation_enabled`` only + ``physxArticulation:articulationEnabled``. Newton's USD importer reads those + attributes, so the fragment that writes them is the PhysX one regardless of + which backend consumes it. + +.. note:: + + The deformable cfgs (``DeformableBodyPropertiesBaseCfg`` and its backend + subclasses) are **not** deprecated: their fragment families do not exist yet. + +**Code migration** + +.. code-block:: python + + # Deprecated: one class bundling the physics:* and physxRigidBody:* namespaces + import isaaclab.sim as sim_utils + rigid_props = sim_utils.RigidBodyPropertiesCfg(kinematic_enabled=False, linear_damping=0.1) + +.. code-block:: python + + # Recommended: one fragment per USD namespace, composed in the spawner slot + from isaaclab.sim.schemas import UsdPhysicsRigidBodyCfg + from isaaclab_physx.sim.schemas import PhysxRigidBodyCfg + + rigid_props = [ + UsdPhysicsRigidBodyCfg(kinematic_enabled=False), + PhysxRigidBodyCfg(linear_damping=0.1), + ] + +A slot also accepts a mapping from a prim-path pattern to a fragment list, which +lets one spawner cfg target different prims with different properties: + +.. code-block:: python + + rigid_props = {"/.*": [UsdPhysicsRigidBodyCfg(kinematic_enabled=False)]} + +Three legacy fields are not USD attributes and therefore have no fragment. They +move to the spawner cfg instead — no fragment covers them, so a migration that +only swaps cfg classes drops them: + +.. list-table:: + :header-rows: 1 + :widths: 50 50 + + * - Deprecated cfg field + - Fragment-API replacement + * - ``ArticulationRootBaseCfg.fix_root_link`` + - ``fix_root_link`` on the spawner cfg, forwarded as the ``fix_root_link`` + argument of + :func:`~isaaclab.sim.schemas.apply_articulation_root_properties` + * - ``JointDriveBaseCfg.ensure_drives_exist`` + - ``ensure_drives_exist`` on the spawner cfg, forwarded as the + ``ensure_drives_exist`` argument of + :func:`~isaaclab.sim.schemas.apply_joint_drive_properties` + * - ``CollisionBaseCfg.mesh_collision_property`` + - the spawner's ``mesh_collision_props`` slot, which takes the + mesh-collision fragments directly + +The renamed joint-drive fields keep working on the fragments as well: +``max_effort`` is a deprecated alias of +:attr:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg.max_force`, and ``max_velocity`` +of :attr:`~isaaclab_physx.sim.schemas.PhysxJointCfg.max_joint_velocity`. + +**Schema writers** + +The ``define_*`` and ``modify_*`` writers are deprecated alongside the cfgs and +will be removed in 3.2. Each has an ``apply_*`` counterpart that takes a +prim-path *expression* (a regular expression over whole prim paths) and a list +of fragments, so one call can author a whole subtree: + +.. list-table:: + :header-rows: 1 + :widths: 55 45 + + * - Deprecated writer + - Replacement + * - ``define_rigid_body_properties``, ``modify_rigid_body_properties`` + - :func:`~isaaclab.sim.schemas.apply_rigid_body_properties` + * - ``define_collision_properties``, ``modify_collision_properties`` + - :func:`~isaaclab.sim.schemas.apply_collision_properties` + * - ``define_mass_properties``, ``modify_mass_properties`` + - :func:`~isaaclab.sim.schemas.apply_mass_properties` + * - ``define_articulation_root_properties``, ``modify_articulation_root_properties`` + - :func:`~isaaclab.sim.schemas.apply_articulation_root_properties` + * - ``modify_joint_drive_properties`` + - :func:`~isaaclab.sim.schemas.apply_joint_drive_properties` + * - ``define_mesh_collision_properties``, ``modify_mesh_collision_properties`` + - :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties` + * - ``modify_fixed_tendon_properties``, ``modify_spatial_tendon_properties`` + - :func:`~isaaclab.sim.schemas.apply_fixed_tendon_properties`, + :func:`~isaaclab.sim.schemas.apply_spatial_tendon_properties` + +.. code-block:: python + + # Deprecated: authors one prim, takes a single bundled cfg + sim_utils.modify_rigid_body_properties("/World/Robot/base", RigidBodyPropertiesCfg(linear_damping=0.1)) + + # Recommended: authors every matching prim, takes a fragment list + sim_utils.apply_rigid_body_properties("/World/Robot/.*", [PhysxRigidBodyCfg(linear_damping=0.1)]) + +The deformable writers (``define_deformable_body_properties``, +``modify_deformable_body_properties``, ``define_deformable_curve_properties``) +are not deprecated. + +**Silencing the warnings while you migrate** + +The warnings are standard ``DeprecationWarning``\ s. Filter them by *message* +while a migration is in progress: + +.. code-block:: python + + import warnings + + # Silence one legacy symbol. + warnings.filterwarnings("ignore", category=DeprecationWarning, message=r"RigidBodyPropertiesCfg is deprecated") + + # Silence every legacy schema cfg and writer at once. + warnings.filterwarnings("ignore", category=DeprecationWarning, message=r"\w+ is deprecated\. Use ") + + # Silence the renamed joint-drive field aliases (``max_effort``, ``max_velocity``). + warnings.filterwarnings("ignore", category=DeprecationWarning, message=r"'\w+' is deprecated; use ") + +.. warning:: + + Do not filter these with ``module="isaaclab.sim.schemas.*"``. ``module`` is + matched against the ``__name__`` of the frame selected by the warning's + ``stacklevel``, and these warnings deliberately point at *your* call site, so + they are attributed to the module that constructed the cfg or called the + writer — never ``isaaclab.sim.schemas``. A ``module=`` filter silences + nothing here. + .. note:: Spawners auto-enable body-level gravity compensation when joint-level diff --git a/source/isaaclab/changelog.d/vidurv-schema-deprecate-legacy.rst b/source/isaaclab/changelog.d/vidurv-schema-deprecate-legacy.rst new file mode 100644 index 000000000000..9059f20488c4 --- /dev/null +++ b/source/isaaclab/changelog.d/vidurv-schema-deprecate-legacy.rst @@ -0,0 +1,39 @@ +Deprecated +^^^^^^^^^^ + +* Deprecated the inheritance-based schema cfg classes in favor of the single-namespace schema + fragments. Each class now raises a ``DeprecationWarning`` on instantiation and will be removed in + 3.2. The warning names *every* fragment the class's fields need, so following it does not drop + authored properties. Replace :class:`~isaaclab.sim.schemas.MassPropertiesCfg` with + :class:`~isaaclab.sim.schemas.MassCfg`; :class:`~isaaclab.sim.schemas.RigidBodyBaseCfg` with + ``[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]``; + :class:`~isaaclab.sim.schemas.CollisionBaseCfg` with + ``[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...)]``; + :class:`~isaaclab.sim.schemas.JointDriveBaseCfg` with + ``[UsdPhysicsDriveCfg(...), PhysxJointCfg(...)]``; + :class:`~isaaclab.sim.schemas.ArticulationRootBaseCfg` with + :class:`~isaaclab_physx.sim.schemas.PhysxArticulationCfg`; and + :class:`~isaaclab.sim.schemas.MeshCollisionBaseCfg`, + :class:`~isaaclab.sim.schemas.BoundingCubePropertiesCfg` and + :class:`~isaaclab.sim.schemas.BoundingSpherePropertiesCfg` with + :class:`~isaaclab.sim.schemas.UsdPhysicsMeshCollisionCfg`. Spawner slots accept fragments + directly, so ``rigid_props=RigidBodyBaseCfg(...)`` becomes + ``rigid_props=[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]``. Three legacy fields have no + fragment and move to the spawner cfg instead: ``fix_root_link``, ``ensure_drives_exist`` (both + also forwarded as arguments of + :func:`~isaaclab.sim.schemas.apply_articulation_root_properties` and + :func:`~isaaclab.sim.schemas.apply_joint_drive_properties`) and ``mesh_collision_property``, which + becomes the spawner's ``mesh_collision_props`` slot. Deformable cfgs are unaffected. +* Deprecated the ``define_*`` and ``modify_*`` schema writers in favor of the fragment-based + ``apply_*`` writers, which take a prim-path expression and a list of fragments. Each writer now + raises a ``DeprecationWarning`` when called and will be removed in 3.2. Replace + ``define_rigid_body_properties`` / ``modify_rigid_body_properties`` with + :func:`~isaaclab.sim.schemas.apply_rigid_body_properties`, and likewise for the collision, mass, + articulation-root, joint-drive, mesh-collision and tendon families. Internal delegation bypasses + the warning wrapper so each public call warns once. Use ``inspect.unwrap(writer)`` to access the + raw per-prim writer; ``modify_*.__wrapped__`` now retains subtree traversal. The deformable writers + are unaffected. +* Reworded the deprecation notices on the previously deprecated ``*PropertiesCfg`` schema aliases + to point at the new fragment replacements instead of the intermediate split classes, so the + whole legacy schema cfg surface is documented to be removed in the same release as the classes + it forwards to. The material and tendon aliases are unaffected. diff --git a/source/isaaclab/isaaclab/sim/schemas/schemas.py b/source/isaaclab/isaaclab/sim/schemas/schemas.py index 11c7cf9336cc..270b1fc5c6ea 100644 --- a/source/isaaclab/isaaclab/sim/schemas/schemas.py +++ b/source/isaaclab/isaaclab/sim/schemas/schemas.py @@ -13,6 +13,7 @@ import numpy as np import warp as wp +from typing_extensions import deprecated from pxr import Gf, Sdf, Usd, UsdGeom, UsdPhysics @@ -380,6 +381,10 @@ def apply_articulation_root_properties( return success +@deprecated( + "define_articulation_root_properties is deprecated. Use apply_articulation_root_properties with schema fragments" + " instead; define_articulation_root_properties will be removed in 3.2." +) def define_articulation_root_properties( prim_path: str, cfg: schemas_cfg.ArticulationRootBaseCfg, stage: Usd.Stage | None = None ): @@ -396,6 +401,10 @@ def define_articulation_root_properties( Raises: ValueError: When the prim path is not valid. TypeError: When the prim already has conflicting API schemas. + + .. deprecated:: 3.1 + Use :func:`apply_articulation_root_properties` with schema fragments instead. This function will be removed + in 3.2. """ # get stage handle if stage is None: @@ -410,7 +419,8 @@ def define_articulation_root_properties( if not UsdPhysics.ArticulationRootAPI(prim): UsdPhysics.ArticulationRootAPI.Apply(prim) # set articulation root properties - modify_articulation_root_properties(prim_path, cfg, stage) + # Internal delegation skips only the deprecation wrapper, retaining subtree traversal. + modify_articulation_root_properties.__wrapped__(prim_path, cfg, stage) def create_world_fixed_joint(articulation_prim: Usd.Prim, stage: Usd.Stage) -> None: @@ -464,6 +474,10 @@ def create_world_fixed_joint(articulation_prim: Usd.Prim, stage: Usd.Stage) -> N joint.CreateBreakTorqueAttr().Set(max_break) +@deprecated( + "modify_articulation_root_properties is deprecated. Use apply_articulation_root_properties with schema fragments" + " instead; modify_articulation_root_properties will be removed in 3.2." +) @apply_nested def modify_articulation_root_properties( prim_path: str, cfg: schemas_cfg.ArticulationRootBaseCfg, stage: Usd.Stage | None = None @@ -506,6 +520,10 @@ def modify_articulation_root_properties( Raises: NotImplementedError: When the root prim is not a rigid body and a fixed joint is to be created. + + .. deprecated:: 3.1 + Use :func:`apply_articulation_root_properties` with schema fragments instead. This function will be removed + in 3.2. """ # get stage handle if stage is None: @@ -833,6 +851,10 @@ def apply_mesh_collision_properties( return success +@deprecated( + "define_rigid_body_properties is deprecated. Use apply_rigid_body_properties with schema fragments" + " instead; define_rigid_body_properties will be removed in 3.2." +) def define_rigid_body_properties(prim_path: str, cfg: schemas_cfg.RigidBodyBaseCfg, stage: Usd.Stage | None = None): """Apply the rigid body schema on the input prim and set its properties. @@ -847,6 +869,10 @@ def define_rigid_body_properties(prim_path: str, cfg: schemas_cfg.RigidBodyBaseC Raises: ValueError: When the prim path is not valid. TypeError: When the prim already has conflicting API schemas. + + .. deprecated:: 3.1 + Use :func:`apply_rigid_body_properties` with schema fragments instead. This function will be removed + in 3.2. """ # get stage handle if stage is None: @@ -861,11 +887,15 @@ def define_rigid_body_properties(prim_path: str, cfg: schemas_cfg.RigidBodyBaseC if not UsdPhysics.RigidBodyAPI(prim): UsdPhysics.RigidBodyAPI.Apply(prim) # set rigid body properties - modify_rigid_body_properties(prim_path, cfg, stage) + modify_rigid_body_properties.__wrapped__(prim_path, cfg, stage) # rigid bodies nest when child links are authored under their parent link prim (URDF importer # in Isaac Sim 6.0+), so keep descending after a success to reach every link +@deprecated( + "modify_rigid_body_properties is deprecated. Use apply_rigid_body_properties with schema fragments" + " instead; modify_rigid_body_properties will be removed in 3.2." +) @apply_nested(stop_on_success=False) def modify_rigid_body_properties( prim_path: str, cfg: schemas_cfg.RigidBodyBaseCfg, stage: Usd.Stage | None = None @@ -898,6 +928,10 @@ def modify_rigid_body_properties( Returns: True if the properties were successfully set, False otherwise. + + .. deprecated:: 3.1 + Use :func:`apply_rigid_body_properties` with schema fragments instead. This function will be removed + in 3.2. """ # get stage handle if stage is None: @@ -981,6 +1015,10 @@ def apply_collision_properties( return success +@deprecated( + "define_collision_properties is deprecated. Use apply_collision_properties with schema fragments" + " instead; define_collision_properties will be removed in 3.2." +) def define_collision_properties( prim_path: str, cfg: schemas_cfg.CollisionPropertiesCfg, stage: Usd.Stage | None = None ): @@ -996,6 +1034,10 @@ def define_collision_properties( Raises: ValueError: When the prim path is not valid. + + .. deprecated:: 3.1 + Use :func:`apply_collision_properties` with schema fragments instead. This function will be removed + in 3.2. """ # get stage handle if stage is None: @@ -1010,9 +1052,13 @@ def define_collision_properties( if not UsdPhysics.CollisionAPI(prim): UsdPhysics.CollisionAPI.Apply(prim) # set collision properties - modify_collision_properties(prim_path, cfg, stage) + modify_collision_properties.__wrapped__(prim_path, cfg, stage) +@deprecated( + "modify_collision_properties is deprecated. Use apply_collision_properties with schema fragments" + " instead; modify_collision_properties will be removed in 3.2." +) @apply_nested def modify_collision_properties( prim_path: str, cfg: schemas_cfg.CollisionPropertiesCfg, stage: Usd.Stage | None = None @@ -1041,6 +1087,10 @@ def modify_collision_properties( Returns: True if the properties were successfully set, False otherwise. + + .. deprecated:: 3.1 + Use :func:`apply_collision_properties` with schema fragments instead. This function will be removed + in 3.2. """ # get stage handle if stage is None: @@ -1054,7 +1104,7 @@ def modify_collision_properties( # dispatch nested mesh-collision cfg if present (preserve legacy behavior) mesh_collision_cfg = getattr(cfg, "mesh_collision_property", None) if mesh_collision_cfg is not None: - modify_mesh_collision_properties(prim_path, mesh_collision_cfg, stage) + modify_mesh_collision_properties.__wrapped__(prim_path, mesh_collision_cfg, stage) # convert to dict, filtering out class metadata (underscore-prefixed keys) cfg_dict = {f.name: getattr(cfg, f.name) for f in dataclasses.fields(cfg)} @@ -1130,6 +1180,10 @@ def apply_mass_properties( return success +@deprecated( + "define_mass_properties is deprecated. Use apply_mass_properties with schema fragments" + " instead; define_mass_properties will be removed in 3.2." +) def define_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, stage: Usd.Stage | None = None): """Apply the mass schema on the input prim and set its properties. @@ -1143,6 +1197,10 @@ def define_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, s Raises: ValueError: When the prim path is not valid. + + .. deprecated:: 3.1 + Use :func:`apply_mass_properties` with schema fragments instead. This function will be removed + in 3.2. """ # get stage handle if stage is None: @@ -1157,11 +1215,15 @@ def define_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, s if not UsdPhysics.MassAPI(prim): UsdPhysics.MassAPI.Apply(prim) # set mass properties - modify_mass_properties(prim_path, cfg, stage) + modify_mass_properties.__wrapped__(prim_path, cfg, stage) # mass is authored on the same link prims as the rigid-body schema, which may nest (see # modify_rigid_body_properties above), so keep descending after a success +@deprecated( + "modify_mass_properties is deprecated. Use apply_mass_properties with schema fragments" + " instead; modify_mass_properties will be removed in 3.2." +) @apply_nested(stop_on_success=False) def modify_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, stage: Usd.Stage | None = None) -> bool: """Set properties for the mass of a rigid body prim. @@ -1191,6 +1253,10 @@ def modify_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, s Returns: True if the properties were successfully set, False otherwise. + + .. deprecated:: 3.1 + Use :func:`apply_mass_properties` with schema fragments instead. This function will be removed + in 3.2. """ # get stage handle if stage is None: @@ -1514,6 +1580,10 @@ def _ensure_drive_exists(drive_cfg, prim) -> None: safe_set_attribute_on_usd_schema(usd_drive_api, "stiffness", stiffness, camel_case=True) +@deprecated( + "modify_joint_drive_properties is deprecated. Use apply_joint_drive_properties with schema fragments" + " instead; modify_joint_drive_properties will be removed in 3.2." +) @apply_nested def modify_joint_drive_properties( prim_path: str, cfg: schemas_cfg.JointDriveBaseCfg, stage: Usd.Stage | None = None @@ -1550,6 +1620,10 @@ def modify_joint_drive_properties( Raises: ValueError: If the input prim path is not valid. + + .. deprecated:: 3.1 + Use :func:`apply_joint_drive_properties` with schema fragments instead. This function will be removed + in 3.2. """ # get stage handle if stage is None: @@ -1709,6 +1783,10 @@ def apply_fixed_tendon_properties( return _apply_tendon_fragments(prim_path_expr, fragments, _FIXED_TENDON_SCHEMAS, ("MjcTendon",), "fixed", stage) +@deprecated( + "modify_fixed_tendon_properties is deprecated. Use apply_fixed_tendon_properties with schema fragments" + " instead; modify_fixed_tendon_properties will be removed in 3.2." +) @apply_nested def modify_fixed_tendon_properties( prim_path: str, cfg: schemas_cfg.PhysxFixedTendonPropertiesCfg, stage: Usd.Stage | None = None @@ -1739,6 +1817,10 @@ def modify_fixed_tendon_properties( Raises: ValueError: If the input prim path is not valid. + + .. deprecated:: 3.1 + Use :func:`apply_fixed_tendon_properties` with schema fragments instead. This function will be removed + in 3.2. """ # Retained for backward compatibility with callers passing PhysxFixedTendonPropertiesCfg # directly. Will be removed in a future release once callers adopt the fragment-based @@ -1795,6 +1877,10 @@ def apply_spatial_tendon_properties( return _apply_tendon_fragments(prim_path_expr, fragments, _SPATIAL_TENDON_SCHEMAS, (), "spatial", stage) +@deprecated( + "modify_spatial_tendon_properties is deprecated. Use apply_spatial_tendon_properties with schema fragments" + " instead; modify_spatial_tendon_properties will be removed in 3.2." +) @apply_nested def modify_spatial_tendon_properties( prim_path: str, cfg: schemas_cfg.PhysxSpatialTendonPropertiesCfg, stage: Usd.Stage | None = None @@ -1825,6 +1911,10 @@ def modify_spatial_tendon_properties( Raises: ValueError: If the input prim path is not valid. + + .. deprecated:: 3.1 + Use :func:`apply_spatial_tendon_properties` with schema fragments instead. This function will be removed + in 3.2. """ # Retained for backward compatibility with callers passing PhysxSpatialTendonPropertiesCfg # directly. Will be removed in a future release once callers adopt the fragment-based @@ -1841,6 +1931,10 @@ def modify_spatial_tendon_properties( """ +@deprecated( + "define_mesh_collision_properties is deprecated. Use apply_mesh_collision_properties with schema fragments" + " instead; define_mesh_collision_properties will be removed in 3.2." +) def define_mesh_collision_properties( prim_path: str, cfg: schemas_cfg.MeshCollisionBaseCfg, stage: Usd.Stage | None = None ): @@ -1856,6 +1950,10 @@ def define_mesh_collision_properties( Raises: ValueError: When the prim path is not valid. + + .. deprecated:: 3.1 + Use :func:`apply_mesh_collision_properties` with schema fragments instead. This function will be removed + in 3.2. """ # obtain stage if stage is None: @@ -1872,9 +1970,13 @@ def define_mesh_collision_properties( if not UsdPhysics.MeshCollisionAPI(prim): UsdPhysics.MeshCollisionAPI.Apply(prim) - modify_mesh_collision_properties(prim_path=prim_path, cfg=cfg, stage=stage) + modify_mesh_collision_properties.__wrapped__(prim_path=prim_path, cfg=cfg, stage=stage) +@deprecated( + "modify_mesh_collision_properties is deprecated. Use apply_mesh_collision_properties with schema fragments" + " instead; modify_mesh_collision_properties will be removed in 3.2." +) @apply_nested def modify_mesh_collision_properties( prim_path: str, cfg: schemas_cfg.MeshCollisionBaseCfg, stage: Usd.Stage | None = None @@ -1905,6 +2007,10 @@ def modify_mesh_collision_properties( Raises: ValueError: When the mesh approximation name is invalid. + + .. deprecated:: 3.1 + Use :func:`apply_mesh_collision_properties` with schema fragments instead. This function will be removed + in 3.2. """ # obtain stage if stage is None: diff --git a/source/isaaclab/isaaclab/sim/schemas/schemas_cfg.py b/source/isaaclab/isaaclab/sim/schemas/schemas_cfg.py index ebb604fb3be8..1522af6d2db1 100644 --- a/source/isaaclab/isaaclab/sim/schemas/schemas_cfg.py +++ b/source/isaaclab/isaaclab/sim/schemas/schemas_cfg.py @@ -9,6 +9,8 @@ from collections.abc import Callable from typing import ClassVar, Literal +from typing_extensions import deprecated + from isaaclab.utils import configclass # Names that moved out of this submodule into ``isaaclab_physx.sim.schemas.schemas_cfg``. @@ -106,6 +108,20 @@ def _deprecate_field_alias(cfg, alias: str, canonical: str) -> None: setattr(cfg, alias, None) +def _deprecated_schema_cfg(replacement: str): + """Warn when a legacy schema cfg is constructed. + + Apply above @configclass. Name all replacement fragments and fields moved to the spawner. + """ + + def decorator(cls): + message = f"{cls.__name__} is deprecated. Use {replacement} instead; {cls.__name__} will be removed in 3.2." + cls.__init__ = deprecated(message)(cls.__init__) + return cls + + return decorator + + @configclass class SchemaFragment: """Base for a single-namespace USD-schema config fragment. @@ -319,11 +335,11 @@ def __post_init__(self): max_effort: float | None = None """Deprecated alias for :attr:`max_force`. - .. deprecated:: 4.6.25 + .. deprecated:: 3.1 Use :attr:`max_force` instead. The cfg field is renamed so its snake_case name maps identity-style to the USD camelCase attribute (``maxForce`` on ``UsdPhysics.DriveAPI``). The alias is forwarded to :attr:`max_force` in :meth:`__post_init__` and will be removed - in 3.1. + in 3.2. """ stiffness: float | None = None @@ -382,6 +398,7 @@ class UsdPhysicsMeshCollisionCfg(MeshCollisionFragment): """ +@_deprecated_schema_cfg("[PhysxArticulationCfg(...)] (and set fix_root_link on the spawner cfg)") @configclass class ArticulationRootBaseCfg: """Solver-common properties to apply to the root of an articulation. @@ -402,6 +419,15 @@ class ArticulationRootBaseCfg: .. note:: If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is. + + .. deprecated:: 3.1 + Use the articulation-root fragments instead: + :class:`~isaaclab_physx.sim.schemas.PhysxArticulationCfg` (which also carries + :attr:`articulation_enabled`) and + :class:`~isaaclab_newton.sim.schemas.NewtonArticulationCfg`. The non-USD + :attr:`fix_root_link` flag is now the ``fix_root_link`` argument of + :func:`~isaaclab.sim.schemas.apply_articulation_root_properties`. This class will be + removed in 3.2. """ # -- Class metadata (not dataclass fields) -- @@ -449,6 +475,7 @@ class ArticulationRootBaseCfg: """ +@_deprecated_schema_cfg("[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]") @configclass class RigidBodyBaseCfg: """Solver-common properties to apply to a rigid body. @@ -466,6 +493,11 @@ class RigidBodyBaseCfg: If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is. + .. deprecated:: 3.1 + Use :class:`UsdPhysicsRigidBodyCfg` for the ``physics:*`` fields and + :class:`~isaaclab_physx.sim.schemas.PhysxRigidBodyCfg` for :attr:`disable_gravity`, + passing both in the spawner's ``rigid_props`` slot. This class will be removed in 3.2. + .. _UsdPhysics.RigidBodyAPI: https://openusd.org/dev/api/class_usd_physics_rigid_body_a_p_i.html """ @@ -515,6 +547,10 @@ class RigidBodyBaseCfg: """ +@_deprecated_schema_cfg( + "[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...)] (and move mesh_collision_property to the" + " spawner's mesh_collision_props slot)" +) @configclass class CollisionBaseCfg: """Solver-common properties to apply to colliders. @@ -535,6 +571,13 @@ class CollisionBaseCfg: If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is. + .. deprecated:: 3.1 + Use :class:`UsdPhysicsCollisionCfg` for :attr:`collision_enabled` and + :class:`~isaaclab_physx.sim.schemas.PhysxCollisionCfg` for :attr:`contact_offset` / + :attr:`rest_offset`, passing both in the spawner's ``collision_props`` slot. The nested + :attr:`mesh_collision_property` is replaced by placing a mesh-collision fragment in the + ``mesh_collision_props`` slot. This class will be removed in 3.2. + .. _UsdPhysics.CollisionAPI: https://openusd.org/dev/api/class_usd_physics_collision_a_p_i.html """ @@ -589,6 +632,7 @@ class CollisionBaseCfg: """ +@_deprecated_schema_cfg("[MassCfg(...)]") @configclass class MassPropertiesCfg: """Properties to define explicit mass properties of a rigid body. @@ -598,6 +642,10 @@ class MassPropertiesCfg: .. note:: If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is. + + .. deprecated:: 3.1 + Use :class:`MassCfg` instead, passed in the spawner's ``mass_props`` slot. It carries the + same :attr:`mass` and :attr:`density` fields. This class will be removed in 3.2. """ # -- Class metadata (not dataclass fields) -- @@ -664,6 +712,9 @@ class MassCfg(MassFragment): """ +@_deprecated_schema_cfg( + "[UsdPhysicsDriveCfg(...), PhysxJointCfg(...)] (and set ensure_drives_exist on the spawner cfg)" +) @configclass class JointDriveBaseCfg: """Solver-common properties to define the drive mechanism of a joint. @@ -681,6 +732,14 @@ class JointDriveBaseCfg: If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is. + .. deprecated:: 3.1 + Use :class:`UsdPhysicsDriveCfg` for the ``UsdPhysics.DriveAPI`` fields and + :class:`~isaaclab_physx.sim.schemas.PhysxJointCfg` for :attr:`max_joint_velocity`, + passing both in the spawner's ``joint_drive_props`` slot. The non-USD + :attr:`ensure_drives_exist` flag is now the ``ensure_drives_exist`` argument of + :func:`~isaaclab.sim.schemas.apply_joint_drive_properties`. This class will be removed + in 3.2. + .. _UsdPhysics.DriveAPI: https://openusd.org/dev/api/class_usd_physics_drive_a_p_i.html """ @@ -718,11 +777,11 @@ def __post_init__(self): max_effort: float | None = None """Deprecated alias for :attr:`max_force`. - .. deprecated:: 4.6.25 + .. deprecated:: 3.1 Use :attr:`max_force` instead. The cfg field is renamed so its snake_case name maps identity-style to the USD camelCase attribute (``maxForce`` on ``UsdPhysics.DriveAPI``). The alias is forwarded to - :attr:`max_force` in :meth:`__post_init__` and will be removed in 3.1. + :attr:`max_force` in :meth:`__post_init__` and will be removed in 3.2. """ stiffness: float | None = None @@ -772,14 +831,15 @@ def __post_init__(self): max_velocity: float | None = None """Deprecated alias for :attr:`max_joint_velocity`. - .. deprecated:: 4.6.25 + .. deprecated:: 3.1 Use :attr:`max_joint_velocity` instead. The cfg field is renamed so its snake_case name maps identity-style to the USD camelCase attribute (``physxJoint:maxJointVelocity``). The alias is forwarded to - :attr:`max_joint_velocity` in :meth:`__post_init__` and will be removed in 3.1. + :attr:`max_joint_velocity` in :meth:`__post_init__` and will be removed in 3.2. """ +@_deprecated_schema_cfg("[UsdPhysicsMeshCollisionCfg(...)]") @configclass class MeshCollisionBaseCfg: """Solver-common properties to apply to a mesh in regards to collision. @@ -794,6 +854,13 @@ class MeshCollisionBaseCfg: .. note:: If the values are None, they are not modified. This is useful when you want to set only a subset of the properties and leave the rest as-is. + + .. deprecated:: 3.1 + Use :class:`UsdPhysicsMeshCollisionCfg` instead, passed in the spawner's + ``mesh_collision_props`` slot. For backend cooking tunables, add the matching cooking + fragment (``Physx*Cfg`` in :mod:`isaaclab_physx.sim.schemas`, ``Newton*Cfg`` in + :mod:`isaaclab_newton.sim.schemas`), whose default approximation token replaces the + :attr:`mesh_approximation_name` string. This class will be removed in 3.2. """ # -- Class metadata (not dataclass fields) -- @@ -820,7 +887,7 @@ def __getattr__(self, name: str): """ if name == "usd_api": warnings.warn( - "'usd_api' attribute is deprecated and will be removed in 3.1. Use class-level" + "'usd_api' attribute is deprecated and will be removed in 3.2. Use class-level" " metadata via getattr(cfg, '_usd_applied_schema').", DeprecationWarning, stacklevel=2, @@ -831,7 +898,7 @@ def __getattr__(self, name: str): return "MeshCollisionAPI" if schema is not None else None if name == "physx_api": warnings.warn( - "'physx_api' attribute is deprecated and will be removed in 3.1. Use class-level" + "'physx_api' attribute is deprecated and will be removed in 3.2. Use class-level" " metadata via getattr(cfg, '_usd_applied_schema').", DeprecationWarning, stacklevel=2, @@ -843,6 +910,7 @@ def __getattr__(self, name: str): raise AttributeError(f"{type(self).__name__!r} object has no attribute {name!r}") +@_deprecated_schema_cfg('[UsdPhysicsMeshCollisionCfg(mesh_approximation_name="boundingCube")]') @configclass class BoundingCubePropertiesCfg(MeshCollisionBaseCfg): """Bounding-cube mesh collision approximation. USD-only; authors no PhysX schema. @@ -852,12 +920,17 @@ class BoundingCubePropertiesCfg(MeshCollisionBaseCfg): Original USD Documentation: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_usd_physics_mesh_collision_a_p_i.html + + .. deprecated:: 3.1 + Use ``UsdPhysicsMeshCollisionCfg(mesh_approximation_name="boundingCube")`` instead. + This class will be removed in 3.2. """ mesh_approximation_name: str = "boundingCube" """Name of mesh collision approximation method. Default: "boundingCube".""" +@_deprecated_schema_cfg('[UsdPhysicsMeshCollisionCfg(mesh_approximation_name="boundingSphere")]') @configclass class BoundingSpherePropertiesCfg(MeshCollisionBaseCfg): """Bounding-sphere mesh collision approximation. USD-only; authors no PhysX schema. @@ -867,6 +940,10 @@ class BoundingSpherePropertiesCfg(MeshCollisionBaseCfg): Original USD Documentation: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_usd_physics_mesh_collision_a_p_i.html + + .. deprecated:: 3.1 + Use ``UsdPhysicsMeshCollisionCfg(mesh_approximation_name="boundingSphere")`` instead. + This class will be removed in 3.2. """ mesh_approximation_name: str = "boundingSphere" diff --git a/source/isaaclab/test/sim/test_schemas.py b/source/isaaclab/test/sim/test_schemas.py index fff310b55a0d..66568bec437f 100644 --- a/source/isaaclab/test/sim/test_schemas.py +++ b/source/isaaclab/test/sim/test_schemas.py @@ -12,6 +12,7 @@ """Rest everything follows.""" +import inspect import math import warnings @@ -151,7 +152,7 @@ def test_max_joint_velocity_on_base_cfg(setup_simulation): prim_path = "/World/Articulation/joint_0" # use unwrapped function (no parent traversal) so this returns the inner bool - schemas.modify_joint_drive_properties.__wrapped__(prim_path, base_cfg) + inspect.unwrap(schemas.modify_joint_drive_properties)(prim_path, base_cfg) # Revolute drives convert rad/s -> deg/s; check the authored value. attr = stage.GetPrimAtPath(prim_path).GetAttribute("physxJoint:maxJointVelocity") @@ -185,7 +186,7 @@ def test_max_velocity_deprecation_alias(setup_simulation): sim_utils.create_prim("/World/Articulation_dep/body1", prim_type="Cube") UsdPhysics.RevoluteJoint.Define(stage, "/World/Articulation_dep/joint_0") prim_path = "/World/Articulation_dep/joint_0" - schemas.modify_joint_drive_properties.__wrapped__(prim_path, base_cfg) + inspect.unwrap(schemas.modify_joint_drive_properties)(prim_path, base_cfg) attr = stage.GetPrimAtPath(prim_path).GetAttribute("physxJoint:maxJointVelocity") assert attr.IsValid() @@ -216,7 +217,7 @@ def test_max_effort_deprecation_alias(setup_simulation): sim_utils.create_prim("/World/Articulation_eff/body1", prim_type="Cube") UsdPhysics.PrismaticJoint.Define(stage, "/World/Articulation_eff/joint_0") prim_path = "/World/Articulation_eff/joint_0" - schemas.modify_joint_drive_properties.__wrapped__(prim_path, base_cfg) + inspect.unwrap(schemas.modify_joint_drive_properties)(prim_path, base_cfg) attr = stage.GetPrimAtPath(prim_path).GetAttribute("drive:linear:physics:maxForce") assert attr.IsValid() @@ -244,7 +245,7 @@ def test_joint_drive_base_no_physx_schema_when_max_joint_velocity_unset(setup_si UsdPhysics.RevoluteJoint.Define(stage, "/World/Articulation/joint_0") prim_path = "/World/Articulation/joint_0" - schemas.modify_joint_drive_properties.__wrapped__(prim_path, base_cfg) + inspect.unwrap(schemas.modify_joint_drive_properties)(prim_path, base_cfg) applied = stage.GetPrimAtPath(prim_path).GetAppliedSchemas() assert "PhysxJointAPI" not in applied, ( @@ -353,7 +354,7 @@ def test_rigid_body_material_deprecation_alias(setup_simulation): RigidBodyMaterialCfg() deprecations = [w for w in caught if issubclass(w.category, DeprecationWarning)] assert len(deprecations) == 1, f"expected exactly one DeprecationWarning, got {len(deprecations)}" - assert "3.1" in str(deprecations[0].message) + assert "3.2" in str(deprecations[0].message) @pytest.mark.isaacsim_ci @@ -459,7 +460,7 @@ def test_collision_deprecation_alias(setup_simulation): PhysxCollisionPropertiesCfgAlias() deprecations = [w for w in caught if issubclass(w.category, DeprecationWarning)] assert len(deprecations) == 1, f"expected exactly one DeprecationWarning, got {len(deprecations)}" - assert "3.1" in str(deprecations[0].message) + assert "3.2" in str(deprecations[0].message) @pytest.mark.isaacsim_ci @@ -557,7 +558,7 @@ def test_articulation_root_deprecation_alias(setup_simulation): ArticulationRootDeprecatedAliasCfg() deprecations = [w for w in caught if issubclass(w.category, DeprecationWarning)] assert len(deprecations) == 1, f"expected exactly one DeprecationWarning, got {len(deprecations)}" - assert "3.1" in str(deprecations[0].message) + assert "3.2" in str(deprecations[0].message) @pytest.mark.isaacsim_ci @@ -666,7 +667,7 @@ def test_mesh_collision_deprecation_aliases(setup_simulation, name): cls() deprecations = [w for w in caught if issubclass(w.category, DeprecationWarning)] assert len(deprecations) == 1, f"{name}: expected one DeprecationWarning, got {len(deprecations)}" - assert "3.1" in str(deprecations[0].message) + assert "3.2" in str(deprecations[0].message) @pytest.mark.isaacsim_ci @@ -701,7 +702,7 @@ def test_fixed_tendon_deprecation_alias(setup_simulation): cls() deprecations = [w for w in caught if issubclass(w.category, DeprecationWarning)] assert len(deprecations) == 1, f"expected one DeprecationWarning, got {len(deprecations)}" - assert "3.1" in str(deprecations[0].message) + assert "3.2" in str(deprecations[0].message) @pytest.mark.isaacsim_ci @@ -734,7 +735,7 @@ def test_spatial_tendon_deprecation_alias(setup_simulation): cls() deprecations = [w for w in caught if issubclass(w.category, DeprecationWarning)] assert len(deprecations) == 1, f"expected one DeprecationWarning, got {len(deprecations)}" - assert "3.1" in str(deprecations[0].message) + assert "3.2" in str(deprecations[0].message) @pytest.mark.isaacsim_ci @@ -942,7 +943,7 @@ def test_multi_instance_schema_detection_on_tendon_joints(setup_simulation): This test ensures both the joint-drive skip predicate and the fixed-tendon writer handle multiple-apply schema tokens correctly. - We call the unwrapped functions directly (via ``__wrapped__``) to bypass the + We call the unwrapped functions directly (via ``inspect.unwrap``) to bypass the ``@apply_nested`` decorator, which traverses children and does not return the inner function's bool result. """ @@ -950,8 +951,8 @@ def test_multi_instance_schema_detection_on_tendon_joints(setup_simulation): stage = sim_utils.get_current_stage() # unwrap to get the raw functions that return bool - _modify_joint_drive = schemas.modify_joint_drive_properties.__wrapped__ - _modify_fixed_tendon = schemas.modify_fixed_tendon_properties.__wrapped__ + _modify_joint_drive = inspect.unwrap(schemas.modify_joint_drive_properties) + _modify_fixed_tendon = inspect.unwrap(schemas.modify_fixed_tendon_properties) # -- set up two body prims connected by a revolute joint sim_utils.create_prim("/World/tendon_test", prim_type="Xform") diff --git a/source/isaaclab/test/sim/test_schemas_deprecation.py b/source/isaaclab/test/sim/test_schemas_deprecation.py new file mode 100644 index 000000000000..dd78648ea0c3 --- /dev/null +++ b/source/isaaclab/test/sim/test_schemas_deprecation.py @@ -0,0 +1,457 @@ +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Tests that the legacy schema cfg classes and schema writers are deprecated but still work. + +The fragment API (one ``@configclass`` per USD applied schema) replaces the inheritance-based +``*PropertiesCfg`` / ``*BaseCfg`` classes and the ``define_*`` / ``modify_*`` writers. Both APIs +coexist: the legacy names must emit a ``DeprecationWarning`` that names their concrete +replacement, and must keep behaving exactly as before. + +These tests run on an in-memory USD stage and do not launch Isaac Sim / Kit. +""" + +import dataclasses +import inspect +import json +import subprocess +import sys +import warnings + +import pytest + +from pxr import Usd, UsdGeom, UsdPhysics + +import isaaclab.sim.schemas as schemas +import isaaclab.sim.schemas.schemas as schemas_impl +import isaaclab.sim.schemas.schemas_cfg as schemas_cfg + +pytestmark = [pytest.mark.unit, pytest.mark.kitless] + + +# Legacy cfg class -> every fragment its warning must name, plus any legacy field that has no +# fragment at all and therefore has to be called out explicitly. A legacy class bundles several +# USD namespaces, so a warning naming only the backend-specific fragment would tell the user to +# drop the properties the class inherits -- these expectations are the whole point of the test. +# Deformable cfgs are intentionally absent: their fragment families do not exist yet, so the +# legacy deformable path cannot be deprecated. Tendon and material cfgs are out of scope here. +_RIGID_BODY = ("UsdPhysicsRigidBodyCfg", "PhysxRigidBodyCfg") +_COLLISION = ("UsdPhysicsCollisionCfg", "PhysxCollisionCfg", "mesh_collision_property") +_JOINT_DRIVE = ("UsdPhysicsDriveCfg", "PhysxJointCfg", "ensure_drives_exist") +_ARTICULATION = ("PhysxArticulationCfg", "fix_root_link") + +DEPRECATED_CORE_CFGS = { + "MassPropertiesCfg": ("MassCfg",), + "RigidBodyBaseCfg": _RIGID_BODY, + "CollisionBaseCfg": _COLLISION, + "ArticulationRootBaseCfg": _ARTICULATION, + "JointDriveBaseCfg": _JOINT_DRIVE, + "MeshCollisionBaseCfg": ("UsdPhysicsMeshCollisionCfg",), + "BoundingCubePropertiesCfg": ("UsdPhysicsMeshCollisionCfg", "boundingCube"), + "BoundingSpherePropertiesCfg": ("UsdPhysicsMeshCollisionCfg", "boundingSphere"), +} + +DEPRECATED_PHYSX_CFGS = { + "PhysxRigidBodyPropertiesCfg": _RIGID_BODY, + "RigidBodyPropertiesCfg": _RIGID_BODY, + "PhysxJointDrivePropertiesCfg": _JOINT_DRIVE, + "JointDrivePropertiesCfg": _JOINT_DRIVE, + "PhysxCollisionPropertiesCfg": _COLLISION, + "CollisionPropertiesCfg": _COLLISION, + "PhysxArticulationRootPropertiesCfg": _ARTICULATION, + "ArticulationRootPropertiesCfg": _ARTICULATION, + "MeshCollisionPropertiesCfg": ("UsdPhysicsMeshCollisionCfg",), + "PhysxConvexHullPropertiesCfg": ("PhysxConvexHullCfg",), + "ConvexHullPropertiesCfg": ("PhysxConvexHullCfg",), + "PhysxConvexDecompositionPropertiesCfg": ("PhysxConvexDecompositionCfg",), + "ConvexDecompositionPropertiesCfg": ("PhysxConvexDecompositionCfg",), + "PhysxTriangleMeshPropertiesCfg": ("PhysxTriangleMeshCfg",), + "TriangleMeshPropertiesCfg": ("PhysxTriangleMeshCfg",), + "PhysxTriangleMeshSimplificationPropertiesCfg": ("PhysxTriangleMeshSimplificationCfg",), + "TriangleMeshSimplificationPropertiesCfg": ("PhysxTriangleMeshSimplificationCfg",), + "PhysxSDFMeshPropertiesCfg": ("PhysxSDFMeshCfg",), + "SDFMeshPropertiesCfg": ("PhysxSDFMeshCfg",), +} + +DEPRECATED_NEWTON_CFGS = { + "NewtonRigidBodyPropertiesCfg": _RIGID_BODY, + "MujocoRigidBodyPropertiesCfg": _RIGID_BODY + ("MujocoRigidBodyCfg",), + "NewtonJointDrivePropertiesCfg": _JOINT_DRIVE, + "MujocoJointDrivePropertiesCfg": _JOINT_DRIVE + ("MujocoJointCfg",), + "NewtonCollisionPropertiesCfg": _COLLISION + ("NewtonCollisionCfg",), + "NewtonMeshCollisionPropertiesCfg": _COLLISION + + ("NewtonCollisionCfg", "UsdPhysicsMeshCollisionCfg", "NewtonMeshCollisionCfg"), + "NewtonSDFCollisionPropertiesCfg": _COLLISION + ("NewtonCollisionCfg", "NewtonSDFCollisionCfg"), + "NewtonArticulationRootPropertiesCfg": _ARTICULATION + ("NewtonArticulationCfg",), +} + +# Replacement fragments, which must stay silent. +CURRENT_CORE_FRAGMENTS = [ + "MassCfg", + "UsdPhysicsRigidBodyCfg", + "UsdPhysicsCollisionCfg", + "UsdPhysicsDriveCfg", + "UsdPhysicsMeshCollisionCfg", +] + +CURRENT_PHYSX_FRAGMENTS = [ + "PhysxRigidBodyCfg", + "PhysxJointCfg", + "PhysxCollisionCfg", + "PhysxArticulationCfg", + "PhysxConvexHullCfg", + "PhysxConvexDecompositionCfg", + "PhysxTriangleMeshCfg", + "PhysxTriangleMeshSimplificationCfg", + "PhysxSDFMeshCfg", +] + +CURRENT_NEWTON_FRAGMENTS = [ + "MujocoRigidBodyCfg", + "MujocoJointCfg", + "NewtonCollisionCfg", + "NewtonMeshCollisionCfg", + "NewtonSDFCollisionCfg", + "NewtonArticulationCfg", +] + +# Legacy writer -> the fragment-based writer named in its warning. ``define_deformable_*`` / +# ``modify_deformable_body_properties`` are excluded for the same reason as the deformable cfgs. +DEPRECATED_WRITERS = { + "define_articulation_root_properties": "apply_articulation_root_properties", + "modify_articulation_root_properties": "apply_articulation_root_properties", + "define_rigid_body_properties": "apply_rigid_body_properties", + "modify_rigid_body_properties": "apply_rigid_body_properties", + "define_collision_properties": "apply_collision_properties", + "modify_collision_properties": "apply_collision_properties", + "define_mass_properties": "apply_mass_properties", + "modify_mass_properties": "apply_mass_properties", + "modify_joint_drive_properties": "apply_joint_drive_properties", + "modify_fixed_tendon_properties": "apply_fixed_tendon_properties", + "modify_spatial_tendon_properties": "apply_spatial_tendon_properties", + "define_mesh_collision_properties": "apply_mesh_collision_properties", + "modify_mesh_collision_properties": "apply_mesh_collision_properties", +} + +EXCLUDED_DEFORMABLE_SYMBOLS = [ + "DeformableBodyPropertiesBaseCfg", + "define_deformable_body_properties", + "modify_deformable_body_properties", + "define_deformable_curve_properties", +] + + +def _physx_cfgs(): + """Import the PhysX schema cfg module, skipping the test when the extension is absent.""" + return pytest.importorskip("isaaclab_physx.sim.schemas.schemas_cfg") + + +def _newton_cfgs(): + """Import the Newton schema cfg module, skipping the test when the extension is absent.""" + return pytest.importorskip("isaaclab_newton.sim.schemas.schemas_cfg") + + +def _deprecations(func): + """Call ``func`` and return the ``DeprecationWarning`` instances it raised.""" + with warnings.catch_warnings(record=True) as caught: + warnings.simplefilter("always") + func() + return [w for w in caught if issubclass(w.category, DeprecationWarning)] + + +def _assert_deprecated_once(cls, expected: tuple[str, ...]) -> None: + """Instantiating ``cls`` raises one deprecation naming every entry of ``expected``, and 5.0.""" + deprecations = _deprecations(cls) + assert len(deprecations) == 1, f"{cls.__name__}: expected one DeprecationWarning, got {len(deprecations)}" + message = str(deprecations[0].message) + assert cls.__name__ in message + missing = [name for name in expected if name not in message] + assert not missing, f"{cls.__name__}: warning omits {missing}: {message}" + assert "3.2" in message, f"{cls.__name__}: warning does not state the removal version: {message}" + + +""" +Deprecated cfg classes. +""" + + +@pytest.mark.parametrize("name,expected", sorted(DEPRECATED_CORE_CFGS.items())) +def test_legacy_core_cfg_warns_on_instantiation(name, expected): + """Each legacy core cfg warns once, naming every fragment its fields need.""" + _assert_deprecated_once(getattr(schemas_cfg, name), expected) + + +@pytest.mark.parametrize("name,expected", sorted(DEPRECATED_PHYSX_CFGS.items())) +def test_legacy_physx_cfg_warns_on_instantiation(name, expected): + """Each legacy PhysX cfg warns once, naming every fragment its fields need.""" + _assert_deprecated_once(getattr(_physx_cfgs(), name), expected) + + +@pytest.mark.parametrize("name,expected", sorted(DEPRECATED_NEWTON_CFGS.items())) +def test_legacy_newton_cfg_warns_on_instantiation(name, expected): + """Each legacy Newton cfg warns once, naming every fragment its fields need.""" + _assert_deprecated_once(getattr(_newton_cfgs(), name), expected) + + +@pytest.mark.parametrize("name", CURRENT_CORE_FRAGMENTS) +def test_core_fragment_does_not_warn(name): + """The replacement core fragments must not warn.""" + assert _deprecations(getattr(schemas_cfg, name)) == [] + + +@pytest.mark.parametrize("name", CURRENT_PHYSX_FRAGMENTS) +def test_physx_fragment_does_not_warn(name): + """The replacement PhysX fragments must not warn.""" + assert _deprecations(getattr(_physx_cfgs(), name)) == [] + + +@pytest.mark.parametrize("name", CURRENT_NEWTON_FRAGMENTS) +def test_newton_fragment_does_not_warn(name): + """The replacement Newton fragments must not warn.""" + assert _deprecations(getattr(_newton_cfgs(), name)) == [] + + +@pytest.mark.parametrize("name", EXCLUDED_DEFORMABLE_SYMBOLS) +def test_deformable_symbol_is_not_deprecated(name): + """Deformable symbols stay undeprecated until their fragment families land.""" + symbol = getattr(schemas, name) + if inspect.isclass(symbol): + assert _deprecations(symbol) == [] + else: + assert ".. deprecated::" not in (symbol.__doc__ or "") + + +# Imports the schema cfg modules for the first time in a fresh interpreter and reports every +# ``DeprecationWarning`` raised while doing so. Run in a subprocess rather than via +# ``importlib.reload``: reloading the shared cfg module rebinds the base classes other already +# imported modules still reference, which would leave two incompatible generations of the class +# hierarchy alive and make the rest of the session order-dependent. +_IMPORT_SILENCE_PROBE = """ +import importlib +import json +import sys +import warnings + +import isaaclab # noqa: F401 # warm up the package itself; the schema modules stay unimported + +modules = [ + "isaaclab.sim.schemas.schemas_cfg", + "isaaclab_physx.sim.schemas.schemas_cfg", + "isaaclab_newton.sim.schemas.schemas_cfg", +] +assert not any(m in sys.modules for m in modules), "schema cfg modules were already imported" + +messages = [] +with warnings.catch_warnings(record=True) as caught: + warnings.simplefilter("always") + for module in modules: + try: + importlib.import_module(module) + except ImportError: + continue + messages = [str(w.message) for w in caught if issubclass(w.category, DeprecationWarning)] + +print("RESULT " + json.dumps(messages)) +""" + + +def test_legacy_cfg_import_does_not_warn(): + """Importing the schema modules must not warn: only construction is deprecated.""" + result = subprocess.run([sys.executable, "-c", _IMPORT_SILENCE_PROBE], capture_output=True, text=True, timeout=600) + assert result.returncode == 0, f"probe failed:\n{result.stdout}\n{result.stderr}" + line = next(ln for ln in result.stdout.splitlines() if ln.startswith("RESULT ")) + assert json.loads(line[len("RESULT ") :]) == [] + + +""" +Deprecated cfg classes keep working. +""" + + +def test_legacy_cfg_keeps_field_values(): + """The deprecation wrapper must forward every constructor argument unchanged.""" + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + cfg = schemas_cfg.MassPropertiesCfg(mass=2.5, density=1200.0) + assert cfg.mass == 2.5 + assert cfg.density == 1200.0 + assert [f.name for f in dataclasses.fields(cfg)] == ["mass", "density"] + + +def test_legacy_cfg_keeps_configclass_helpers(): + """``to_dict`` / ``copy`` / ``replace`` must survive the deprecation wrapper.""" + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + cfg = schemas_cfg.MassPropertiesCfg(mass=2.5, density=1200.0) + assert cfg.to_dict()["mass"] == 2.5 + assert cfg.copy().density == 1200.0 + assert cfg.replace(mass=4.0).mass == 4.0 + assert dataclasses.replace(cfg, mass=6.0).mass == 6.0 + + +def test_legacy_cfg_keeps_init_signature(): + """``inspect.signature`` must still report the dataclass fields, not ``*args, **kwargs``.""" + parameters = inspect.signature(schemas_cfg.MassPropertiesCfg.__init__).parameters + assert list(parameters) == ["self", "mass", "density"] + + +def test_legacy_cfg_keeps_field_alias_forwarding(): + """The renamed-field aliases on the legacy joint-drive cfg still forward.""" + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + cfg = schemas_cfg.JointDriveBaseCfg(max_effort=80.0, max_velocity=5.0) + assert cfg.max_force == 80.0 + assert cfg.max_joint_velocity == 5.0 + + +def test_legacy_cfg_subclass_warns_only_for_itself(): + """A legacy subclass warns once for its own name, not once per legacy base.""" + physx_cfg = _physx_cfgs() + deprecations = _deprecations(physx_cfg.RigidBodyPropertiesCfg) + assert len(deprecations) == 1 + assert "RigidBodyPropertiesCfg is deprecated" in str(deprecations[0].message) + + +""" +Deprecated writers. +""" + + +def _stage_with_rigid_body() -> tuple[Usd.Stage, str]: + """Return an in-memory stage carrying one rigid-body prim, and that prim's path.""" + stage = Usd.Stage.CreateInMemory() + prim_path = "/World/Body" + prim = UsdGeom.Cube.Define(stage, prim_path).GetPrim() + UsdPhysics.RigidBodyAPI.Apply(prim) + UsdPhysics.MassAPI.Apply(prim) + return stage, prim_path + + +@pytest.mark.parametrize("name,replacement", sorted(DEPRECATED_WRITERS.items())) +def test_legacy_writer_documents_its_replacement(name, replacement): + """Every legacy writer carries a ``.. deprecated::`` note naming its fragment writer.""" + doc = getattr(schemas, name).__doc__ or "" + assert ".. deprecated:: 3.1" in doc, f"{name}: missing deprecation directive" + assert replacement in doc, f"{name}: docstring does not name '{replacement}'" + assert "removed" in doc and "3.2" in doc, f"{name}: docstring does not state the removal version" + + +@pytest.mark.parametrize("name", ["define_mass_properties", "modify_mass_properties"]) +def test_legacy_mass_writer_warns_once_and_traverses_children(name): + """Direct and delegated writers warn at the caller and retain subtree traversal.""" + stage, prim_path = _stage_with_rigid_body() + child = UsdGeom.Cube.Define(stage, f"{prim_path}/Child").GetPrim() + UsdPhysics.MassAPI.Apply(child) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + cfg = schemas_cfg.MassPropertiesCfg(mass=3.0) + + deprecations = _deprecations(lambda: getattr(schemas, name)(prim_path, cfg, stage)) + assert len(deprecations) == 1 + assert deprecations[0].filename == __file__ + message = str(deprecations[0].message) + assert f"{name} is deprecated" in message + assert "apply_mass_properties" in message + assert "3.2" in message + assert stage.GetPrimAtPath(prim_path).GetAttribute("physics:mass").Get() == pytest.approx(3.0) + assert child.GetAttribute("physics:mass").Get() == pytest.approx(3.0) + + +@pytest.mark.parametrize("name", ["define_collision_properties", "modify_collision_properties"]) +def test_legacy_collision_writer_warns_once_despite_mesh_delegation(name): + """Nested mesh configuration still writes through multiple legacy writer calls.""" + stage = Usd.Stage.CreateInMemory() + prim_path = "/World/Mesh" + prim = UsdGeom.Mesh.Define(stage, prim_path).GetPrim() + UsdPhysics.CollisionAPI.Apply(prim) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + cfg = schemas_cfg.CollisionBaseCfg( + mesh_collision_property=schemas_cfg.MeshCollisionBaseCfg(mesh_approximation_name="boundingCube") + ) + + deprecations = _deprecations(lambda: getattr(schemas, name)(prim_path, cfg, stage)) + assert len(deprecations) == 1 + assert f"{name} is deprecated" in str(deprecations[0].message) + assert UsdPhysics.MeshCollisionAPI(prim).GetApproximationAttr().Get() == "boundingCube" + + +def test_modify_rigid_body_properties_warns_and_writes(): + """The legacy rigid-body writer warns once and still authors ``physics:kinematicEnabled``.""" + stage, prim_path = _stage_with_rigid_body() + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + cfg = schemas_cfg.RigidBodyBaseCfg(kinematic_enabled=True) + + deprecations = _deprecations(lambda: schemas.modify_rigid_body_properties(prim_path, cfg, stage)) + assert len(deprecations) == 1 + assert "apply_rigid_body_properties" in str(deprecations[0].message) + assert stage.GetPrimAtPath(prim_path).GetAttribute("physics:kinematicEnabled").Get() is True + + +def test_apply_mass_properties_does_not_warn(): + """The fragment writer is the replacement and must stay silent.""" + stage, prim_path = _stage_with_rigid_body() + fragment = schemas_cfg.MassCfg(mass=5.0) + + deprecations = _deprecations(lambda: schemas.apply_mass_properties(prim_path, [fragment], stage=stage)) + assert deprecations == [] + assert stage.GetPrimAtPath(prim_path).GetAttribute("physics:mass").Get() == pytest.approx(5.0) + + +def test_legacy_writers_do_not_track_warning_depth(): + """Keep deprecation at public entry points, without custom nesting state.""" + for name in ("_deprecated_schema_writer", "_legacy_writer_state", "_legacy_writer_depth"): + assert not hasattr(schemas_impl, name) + + +""" +Silencing the warnings, as documented in the 3.0 migration guide. +""" + + +def _surviving(probe, **filter_kwargs) -> int: + """Return how many ``DeprecationWarning`` instances ``probe`` raises under ``filter_kwargs``.""" + with warnings.catch_warnings(record=True) as caught: + warnings.simplefilter("always") + warnings.filterwarnings("ignore", category=DeprecationWarning, **filter_kwargs) + probe() + return len([w for w in caught if issubclass(w.category, DeprecationWarning)]) + + +def _legacy_writer_probe(): + stage, prim_path = _stage_with_rigid_body() + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + cfg = schemas_cfg.MassPropertiesCfg(mass=3.0) + schemas.modify_mass_properties(prim_path, cfg, stage) + + +def test_documented_message_filter_silences_legacy_cfgs_and_writers(): + """The message regex in the migration guide silences the cfg and writer deprecations.""" + assert _surviving(schemas_cfg.MassPropertiesCfg, message=r"\w+ is deprecated\. Use ") == 0 + assert _surviving(_legacy_writer_probe, message=r"\w+ is deprecated\. Use ") == 0 + + +def test_documented_message_filter_silences_renamed_field_aliases(): + """The alias regex in the migration guide silences ``max_effort`` / ``max_velocity``.""" + + def probe(): + schemas_cfg.JointDriveBaseCfg(max_effort=80.0, max_velocity=5.0) + + # Three deprecations fire: the legacy class plus one per alias. Only the aliases are filtered. + assert _surviving(probe, message="no-such-warning") == 3 + assert _surviving(probe, message=r"\'\w+\' is deprecated; use ") == 1 + + +def test_module_filter_cannot_silence_these_warnings(): + """``module=`` matches the caller's module, so it never matches the schema modules. + + The warnings intentionally use ``stacklevel`` to point at the user's call site. A filter + keyed on ``isaaclab.sim.schemas`` therefore silences nothing, which is why the migration + guide documents a ``message=`` filter instead. + """ + assert _surviving(schemas_cfg.MassPropertiesCfg, module="isaaclab.sim.schemas.*") == 1 + assert _surviving(_legacy_writer_probe, module="isaaclab.sim.schemas.*") == 1 diff --git a/source/isaaclab/test/sim/test_schemas_shim.py b/source/isaaclab/test/sim/test_schemas_shim.py index 895be4823fc5..6db6779ea941 100644 --- a/source/isaaclab/test/sim/test_schemas_shim.py +++ b/source/isaaclab/test/sim/test_schemas_shim.py @@ -183,14 +183,19 @@ def test_deprecated_material_aliases_emit_deprecation_warning(name): getattr(materials, name)() deprecations = [w for w in caught if issubclass(w.category, DeprecationWarning)] assert len(deprecations) == 1, f"{name}: expected one DeprecationWarning, got {len(deprecations)}" - assert "3.1" in str(deprecations[0].message) + assert "3.2" in str(deprecations[0].message) def test_new_class_does_not_emit_deprecation_warning(): - """Instantiating ``PhysxRigidBodyPropertiesCfg`` directly does NOT emit ``DeprecationWarning``.""" + """Instantiating the ``PhysxRigidBodyCfg`` fragment does NOT emit ``DeprecationWarning``. + + Both ``RigidBodyPropertiesCfg`` and the ``PhysxRigidBodyPropertiesCfg`` it forwards to are + now deprecated in favor of the single-namespace fragments, so the fragment is the class + that must stay silent. See ``test_schemas_deprecation.py`` for the full coverage. + """ with warnings.catch_warnings(record=True) as caught: warnings.simplefilter("always") - schemas.PhysxRigidBodyPropertiesCfg() + physx_cfg.PhysxRigidBodyCfg() assert not any(issubclass(w.category, DeprecationWarning) for w in caught) diff --git a/source/isaaclab/test/sim/test_tendon_fragments.py b/source/isaaclab/test/sim/test_tendon_fragments.py index 53daf7b64799..0afd370b4c4a 100644 --- a/source/isaaclab/test/sim/test_tendon_fragments.py +++ b/source/isaaclab/test/sim/test_tendon_fragments.py @@ -13,6 +13,7 @@ """Rest everything follows.""" import dataclasses +import inspect import pytest from isaaclab_newton.sim.schemas import MujocoFixedTendonCfg, apply_mujoco_fixed_tendon @@ -189,7 +190,7 @@ def test_legacy_spatial_tendon_writer_uses_root_property_namespace(): "/World/STlegacy", ["PhysxTendonAttachmentRootAPI:r0", "PhysxTendonAttachmentLeafAPI:l0"], ) - writer = modify_spatial_tendon_properties.__wrapped__ + writer = inspect.unwrap(modify_spatial_tendon_properties) assert writer("/World/STlegacy", PhysxSpatialTendonPropertiesCfg(stiffness=6.0), stage) assert prim.GetAttribute("physxTendon:r0:stiffness").Get() == pytest.approx(6.0) assert not prim.GetAttribute("physxTendon:l0:stiffness").IsValid() @@ -217,7 +218,7 @@ def test_legacy_physx_tendon_cfg_does_not_leak_physx_only_fields_to_mujoco(): stage = _new_sim() prim = stage.DefinePrim("/World/LegacyMjcTendon", "MjcTendon") cfg = PhysxFixedTendonPropertiesCfg(stiffness=2.0, damping=0.25, lower_limit=-1.0, upper_limit=1.0) - assert modify_fixed_tendon_properties.__wrapped__(str(prim.GetPath()), cfg, stage) + assert inspect.unwrap(modify_fixed_tendon_properties)(str(prim.GetPath()), cfg, stage) assert prim.GetAttribute("mjc:stiffness").Get() == pytest.approx(2.0) assert prim.GetAttribute("mjc:damping").Get() == pytest.approx(0.25) assert not prim.HasAttribute("mjc:lowerLimit") diff --git a/source/isaaclab_newton/changelog.d/vidurv-schema-deprecate-legacy.rst b/source/isaaclab_newton/changelog.d/vidurv-schema-deprecate-legacy.rst new file mode 100644 index 000000000000..235bd6537717 --- /dev/null +++ b/source/isaaclab_newton/changelog.d/vidurv-schema-deprecate-legacy.rst @@ -0,0 +1,28 @@ +Deprecated +^^^^^^^^^^ + +* Deprecated the Newton and MuJoCo schema cfg classes in favor of the single-namespace schema + fragments. Each class now raises a ``DeprecationWarning`` on instantiation and will be removed in + 3.2. The warning names *every* fragment the class's fields need, including the fields it inherits + from a legacy base, so following it does not drop authored properties. Replace + :class:`~isaaclab_newton.sim.schemas.NewtonRigidBodyPropertiesCfg` with + ``[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]`` and + :class:`~isaaclab_newton.sim.schemas.MujocoRigidBodyPropertiesCfg` with that pair plus + :class:`~isaaclab_newton.sim.schemas.MujocoRigidBodyCfg`; + :class:`~isaaclab_newton.sim.schemas.NewtonJointDrivePropertiesCfg` with + ``[UsdPhysicsDriveCfg(...), PhysxJointCfg(...)]`` and + :class:`~isaaclab_newton.sim.schemas.MujocoJointDrivePropertiesCfg` with that pair plus + :class:`~isaaclab_newton.sim.schemas.MujocoJointCfg`; + :class:`~isaaclab_newton.sim.schemas.NewtonCollisionPropertiesCfg` with + ``[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...), NewtonCollisionCfg(...)]``; + :class:`~isaaclab_newton.sim.schemas.NewtonMeshCollisionPropertiesCfg` with those three plus + :class:`~isaaclab.sim.schemas.UsdPhysicsMeshCollisionCfg` and + :class:`~isaaclab_newton.sim.schemas.NewtonMeshCollisionCfg`; + :class:`~isaaclab_newton.sim.schemas.NewtonSDFCollisionPropertiesCfg` with those three plus + :class:`~isaaclab_newton.sim.schemas.NewtonSDFCollisionCfg`; and + :class:`~isaaclab_newton.sim.schemas.NewtonArticulationRootPropertiesCfg` with + ``[PhysxArticulationCfg(...), NewtonArticulationCfg(...)]``. The PhysX fragments appear here + because ``disable_gravity``, ``max_joint_velocity``, ``contact_offset`` / ``rest_offset`` and + ``articulation_enabled`` have no other USD home today and Newton's importer reads those + attributes. Pass fragments as a list in the matching spawner slot. The Newton deformable cfgs are + unaffected. diff --git a/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas_cfg.py b/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas_cfg.py index 38a8729cd13e..57d9b9aa34e7 100644 --- a/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas_cfg.py +++ b/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas_cfg.py @@ -21,11 +21,13 @@ MeshCollisionFragment, RigidBodyBaseCfg, RigidBodyFragment, + _deprecated_schema_cfg, ) from isaaclab.sim.spawners.materials.physics_materials_cfg import RigidBodyMaterialBaseCfg from isaaclab.utils import configclass +@_deprecated_schema_cfg("[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]") @configclass class NewtonRigidBodyPropertiesCfg(RigidBodyBaseCfg): """Newton-targeted rigid body properties. @@ -40,6 +42,14 @@ class NewtonRigidBodyPropertiesCfg(RigidBodyBaseCfg): rigid-body fields can be added without an API change. See :meth:`~isaaclab.sim.schemas.modify_rigid_body_properties` for more information. + + .. deprecated:: 3.1 + Use rigid-body fragments in the spawner's ``rigid_props`` slot instead: + :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg` for the ``physics:*`` fields and + :class:`~isaaclab_physx.sim.schemas.PhysxRigidBodyCfg` for the inherited + ``disable_gravity``, whose only USD home is ``physxRigidBody:disableGravity`` (Newton's + importer reads it). This class carries no ``mjc:*`` field; add + :class:`MujocoRigidBodyCfg` only for ``gravcomp``. This class will be removed in 3.2. """ _usd_namespace: ClassVar[str | None] = "newton" @@ -65,6 +75,7 @@ class NewtonDeformableBodyPropertiesCfg(DeformableBodyPropertiesBaseCfg): _usd_field_exceptions: ClassVar[dict] = {} +@_deprecated_schema_cfg("[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...), MujocoRigidBodyCfg(...)]") @configclass class MujocoRigidBodyPropertiesCfg(NewtonRigidBodyPropertiesCfg): """MuJoCo-solver-specific rigid body properties. @@ -76,6 +87,16 @@ class MujocoRigidBodyPropertiesCfg(NewtonRigidBodyPropertiesCfg): .. note:: If the values are None, they are not modified. + + .. deprecated:: 3.1 + Pass ``[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...), MujocoRigidBodyCfg(...)]`` in + the spawner's ``rigid_props`` slot instead: + :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg` carries the inherited + ``rigid_body_enabled`` / ``kinematic_enabled``, + :class:`~isaaclab_physx.sim.schemas.PhysxRigidBodyCfg` the inherited ``disable_gravity``, + and :class:`MujocoRigidBodyCfg` the ``mjc:gravcomp`` field defined here. Naming only + :class:`MujocoRigidBodyCfg` would silently drop the inherited fields. This class will be + removed in 3.2. """ _usd_namespace: ClassVar[str | None] = "mjc" @@ -145,6 +166,9 @@ class MujocoJointCfg(JointDriveFragment): """ +@_deprecated_schema_cfg( + "[UsdPhysicsDriveCfg(...), PhysxJointCfg(...)] (and set ensure_drives_exist on the spawner cfg)" +) @configclass class NewtonJointDrivePropertiesCfg(JointDriveBaseCfg): """Newton-targeted joint drive properties. @@ -159,6 +183,15 @@ class NewtonJointDrivePropertiesCfg(JointDriveBaseCfg): joint-drive fields can be added without an API change. See :meth:`~isaaclab.sim.schemas.modify_joint_drive_properties` for more information. + + .. deprecated:: 3.1 + Use joint-drive fragments in the spawner's ``joint_drive_props`` slot instead: + :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` for the ``UsdPhysics.DriveAPI`` fields + (``drive_type``, ``stiffness``, ``damping``, ``max_force``) and + :class:`~isaaclab_physx.sim.schemas.PhysxJointCfg` for ``max_joint_velocity``, whose only + USD home is ``physxJoint:maxJointVelocity``. This class carries no ``mjc:*`` field; add + :class:`MujocoJointCfg` only for ``actuatorgravcomp``. ``ensure_drives_exist`` has no + fragment: it is a field on the spawner cfg. This class will be removed in 3.2. """ _usd_namespace: ClassVar[str | None] = "newton" @@ -166,6 +199,10 @@ class NewtonJointDrivePropertiesCfg(JointDriveBaseCfg): _usd_field_exceptions: ClassVar[dict] = {} +@_deprecated_schema_cfg( + "[UsdPhysicsDriveCfg(...), PhysxJointCfg(...), MujocoJointCfg(...)] (and set ensure_drives_exist on" + " the spawner cfg)" +) @configclass class MujocoJointDrivePropertiesCfg(NewtonJointDrivePropertiesCfg): """MuJoCo-solver-specific joint drive properties. @@ -177,6 +214,15 @@ class MujocoJointDrivePropertiesCfg(NewtonJointDrivePropertiesCfg): .. note:: If the values are None, they are not modified. + + .. deprecated:: 3.1 + Pass ``[UsdPhysicsDriveCfg(...), PhysxJointCfg(...), MujocoJointCfg(...)]`` in the + spawner's ``joint_drive_props`` slot instead: + :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` carries the inherited + ``UsdPhysics.DriveAPI`` fields, :class:`~isaaclab_physx.sim.schemas.PhysxJointCfg` the + inherited ``max_joint_velocity``, and :class:`MujocoJointCfg` the ``mjc:actuatorgravcomp`` + field defined here. ``ensure_drives_exist`` has no fragment: it is a field on the spawner + cfg. This class will be removed in 3.2. """ _usd_namespace: ClassVar[str | None] = "mjc" @@ -296,6 +342,10 @@ class NewtonCollisionCfg(CollisionFragment): """ +@_deprecated_schema_cfg( + "[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...), NewtonCollisionCfg(...)] (and move" + " mesh_collision_property to the spawner's mesh_collision_props slot)" +) @configclass class NewtonCollisionPropertiesCfg(CollisionBaseCfg): """Newton-specific collision properties. @@ -307,6 +357,15 @@ class NewtonCollisionPropertiesCfg(CollisionBaseCfg): .. note:: If the values are None, they are not modified. + + .. deprecated:: 3.1 + Pass ``[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...), NewtonCollisionCfg(...)]`` in + the spawner's ``collision_props`` slot instead: + :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` carries ``collision_enabled``, + :class:`~isaaclab_physx.sim.schemas.PhysxCollisionCfg` the inherited ``contact_offset`` / + ``rest_offset``, and :class:`NewtonCollisionCfg` the ``newton:*`` fields defined here. The + nested ``mesh_collision_property`` has no fragment: pass the mesh-collision fragments in + the spawner's ``mesh_collision_props`` slot instead. This class will be removed in 3.2. """ _usd_namespace: ClassVar[str | None] = "newton" @@ -331,6 +390,11 @@ class NewtonCollisionPropertiesCfg(CollisionBaseCfg): """ +@_deprecated_schema_cfg( + "[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...), NewtonCollisionCfg(...)," + " UsdPhysicsMeshCollisionCfg(...), NewtonMeshCollisionCfg(...)] (and move mesh_collision_property" + " to the spawner's mesh_collision_props slot)" +) @configclass class NewtonMeshCollisionPropertiesCfg(NewtonCollisionPropertiesCfg, MeshCollisionBaseCfg): """Newton-specific mesh collision properties. @@ -341,6 +405,14 @@ class NewtonMeshCollisionPropertiesCfg(NewtonCollisionPropertiesCfg, MeshCollisi .. note:: If the values are None, they are not modified. + + .. deprecated:: 3.1 + Pass :class:`NewtonMeshCollisionCfg` together with + :class:`~isaaclab.sim.schemas.UsdPhysicsMeshCollisionCfg` (for ``mesh_approximation_name``) + in the spawner's ``mesh_collision_props`` slot, and the inherited collision fields as + ``[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...), NewtonCollisionCfg(...)]`` in the + ``collision_props`` slot. Naming only :class:`NewtonMeshCollisionCfg` would silently drop + the inherited fields. This class will be removed in 3.2. """ _usd_namespace: ClassVar[str | None] = "newton" @@ -356,6 +428,11 @@ class NewtonMeshCollisionPropertiesCfg(NewtonCollisionPropertiesCfg, MeshCollisi """ +@_deprecated_schema_cfg( + "[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...), NewtonCollisionCfg(...)," + " NewtonSDFCollisionCfg(...)] (and move mesh_collision_property to the spawner's" + " mesh_collision_props slot)" +) @configclass class NewtonSDFCollisionPropertiesCfg(NewtonCollisionPropertiesCfg): """Newton-specific SDF and hydroelastic collision properties. @@ -367,6 +444,13 @@ class NewtonSDFCollisionPropertiesCfg(NewtonCollisionPropertiesCfg): .. note:: If the values are None, they are not modified. + + .. deprecated:: 3.1 + Pass :class:`NewtonSDFCollisionCfg` in the spawner's ``mesh_collision_props`` slot (its + cooking schema implies the ``sdf`` approximation token), and the inherited collision + fields as ``[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...), NewtonCollisionCfg(...)]`` + in the ``collision_props`` slot. Naming only :class:`NewtonSDFCollisionCfg` would silently + drop the inherited fields. This class will be removed in 3.2. """ _usd_namespace: ClassVar[str | None] = "newton" @@ -630,6 +714,9 @@ class MujocoFixedTendonCfg(FixedTendonFragment): """Damping term acting on the tendon length [N·s/m].""" +@_deprecated_schema_cfg( + "[PhysxArticulationCfg(...), NewtonArticulationCfg(...)] (and set fix_root_link on the spawner cfg)" +) @configclass class NewtonArticulationRootPropertiesCfg(ArticulationRootBaseCfg): """Newton-specific articulation root properties. @@ -641,6 +728,17 @@ class NewtonArticulationRootPropertiesCfg(ArticulationRootBaseCfg): .. note:: If the values are None, they are not modified. + + .. deprecated:: 3.1 + Pass ``[PhysxArticulationCfg(...), NewtonArticulationCfg(...)]`` in the spawner's + ``articulation_props`` slot instead: + :class:`~isaaclab_physx.sim.schemas.PhysxArticulationCfg` carries the inherited + ``articulation_enabled``, whose only USD home is + ``physxArticulation:articulationEnabled``, and :class:`NewtonArticulationCfg` the + ``newton:selfCollisionEnabled`` field defined here. The non-USD ``fix_root_link`` flag has + no fragment: it is a field on the spawner cfg and the ``fix_root_link`` argument of + :func:`~isaaclab.sim.schemas.apply_articulation_root_properties`. This class will be + removed in 3.2. """ _usd_namespace: ClassVar[str | None] = "newton" diff --git a/source/isaaclab_physx/changelog.d/vidurv-schema-deprecate-legacy.rst b/source/isaaclab_physx/changelog.d/vidurv-schema-deprecate-legacy.rst new file mode 100644 index 000000000000..26ef3b48a833 --- /dev/null +++ b/source/isaaclab_physx/changelog.d/vidurv-schema-deprecate-legacy.rst @@ -0,0 +1,27 @@ +Deprecated +^^^^^^^^^^ + +* Deprecated the PhysX schema cfg classes in favor of the single-namespace schema fragments. Each + class now raises a ``DeprecationWarning`` on instantiation and will be removed in 3.2. The warning + names *every* fragment the class's fields need, including the fields it inherits from a legacy + base, so following it does not drop authored properties. Replace + :class:`~isaaclab_physx.sim.schemas.PhysxRigidBodyPropertiesCfg` with + ``[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]``; + :class:`~isaaclab_physx.sim.schemas.PhysxJointDrivePropertiesCfg` with + ``[UsdPhysicsDriveCfg(...), PhysxJointCfg(...)]``; + :class:`~isaaclab_physx.sim.schemas.PhysxCollisionPropertiesCfg` with + ``[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...)]``; + :class:`~isaaclab_physx.sim.schemas.PhysxArticulationRootPropertiesCfg` with + :class:`~isaaclab_physx.sim.schemas.PhysxArticulationCfg`; and the + ``Physx*MeshPropertiesCfg`` cooking classes with their ``Physx*Cfg`` fragments + (:class:`~isaaclab_physx.sim.schemas.PhysxConvexHullCfg`, + :class:`~isaaclab_physx.sim.schemas.PhysxConvexDecompositionCfg`, + :class:`~isaaclab_physx.sim.schemas.PhysxTriangleMeshCfg`, + :class:`~isaaclab_physx.sim.schemas.PhysxTriangleMeshSimplificationCfg`, + :class:`~isaaclab_physx.sim.schemas.PhysxSDFMeshCfg`). Pass fragments as a list in the matching + spawner slot. The PhysX deformable and tendon cfgs are unaffected. +* Reworded the Isaac Lab 2.x schema aliases (``RigidBodyPropertiesCfg``, ``JointDrivePropertiesCfg``, + ``CollisionPropertiesCfg``, ``ArticulationRootPropertiesCfg``, ``MeshCollisionPropertiesCfg`` and + the mesh-cooking aliases) to point their ``DeprecationWarning`` at the fragment replacement rather + than at the now also-deprecated ``Physx*PropertiesCfg`` classes. The material and tendon aliases + are unaffected. diff --git a/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas_cfg.py b/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas_cfg.py index 9eda0fe88395..ea0199eb5885 100644 --- a/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas_cfg.py +++ b/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas_cfg.py @@ -24,6 +24,7 @@ RigidBodyFragment, SpatialTendonFragment, _deprecate_field_alias, + _deprecated_schema_cfg, ) from isaaclab.utils import configclass @@ -160,7 +161,7 @@ class PhysxDeformableBodyPropertiesCfg( class DeformableBodyPropertiesCfg(PhysxDeformableBodyPropertiesCfg): """Deprecated: use :class:`PhysxDeformableBodyPropertiesCfg`. - .. deprecated:: 4.6.x + .. deprecated:: 3.1 ``DeformableBodyPropertiesCfg`` has moved to :class:`PhysxDeformableBodyPropertiesCfg` for PhysX-specific deformable properties and is scheduled for removal in 4.0. @@ -168,7 +169,7 @@ class DeformableBodyPropertiesCfg(PhysxDeformableBodyPropertiesCfg): def __post_init__(self): warnings.warn( - "'DeformableBodyPropertiesCfg' is deprecated and will be removed in 3.1. Use" + "'DeformableBodyPropertiesCfg' is deprecated and will be removed in 3.2. Use" " 'isaaclab_physx.sim.schemas.PhysxDeformableBodyPropertiesCfg' instead.", DeprecationWarning, stacklevel=2, @@ -176,6 +177,7 @@ def __post_init__(self): super().__post_init__() +@_deprecated_schema_cfg("[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]") @configclass class PhysxRigidBodyPropertiesCfg(RigidBodyBaseCfg): """PhysX-specific rigid body properties. @@ -189,6 +191,11 @@ class PhysxRigidBodyPropertiesCfg(RigidBodyBaseCfg): the properties and leave the rest as-is. .. _PhysxRigidBodyAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/104.2/class_physx_schema_physx_rigid_body_a_p_i.html + + .. deprecated:: 3.1 + Use :class:`PhysxRigidBodyCfg` instead, passed in the spawner's ``rigid_props`` slot + alongside :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg` for the ``physics:*`` + fields. This class will be removed in 3.2. """ # PhysX-specific fields below all live under the ``PhysxRigidBodyAPI`` schema's @@ -292,28 +299,19 @@ class PhysxRigidBodyCfg(RigidBodyFragment): """ +@_deprecated_schema_cfg("[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]") @configclass class RigidBodyPropertiesCfg(PhysxRigidBodyPropertiesCfg): - """Deprecated: use :class:`PhysxRigidBodyPropertiesCfg` or :class:`~isaaclab.sim.schemas.RigidBodyBaseCfg`. + """Deprecated: use the rigid-body schema fragments. - .. deprecated:: 4.6.22 - ``RigidBodyPropertiesCfg`` has been split into - :class:`~isaaclab.sim.schemas.RigidBodyBaseCfg` (solver-common) and - :class:`PhysxRigidBodyPropertiesCfg` (PhysX-specific) and relocated to - :mod:`isaaclab_physx.sim.schemas`. This alias preserves backwards compatibility and is - scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass ``[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]`` in the spawner's + ``rigid_props`` slot instead: :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg` + carries the ``physics:*`` fields and :class:`PhysxRigidBodyCfg` the + ``physxRigidBody:*`` ones (including ``disable_gravity``). This class will be removed + in 3.2. """ - def __post_init__(self): - warnings.warn( - "'RigidBodyPropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab_physx.sim.schemas.PhysxRigidBodyPropertiesCfg' for PhysX properties, or" - " 'isaaclab.sim.schemas.RigidBodyBaseCfg' for solver-common properties only.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - @configclass class PhysxJointCfg(JointDriveFragment): @@ -357,14 +355,17 @@ def __post_init__(self): max_velocity: float | None = None """Deprecated alias for :attr:`max_joint_velocity`. - .. deprecated:: 4.6.25 + .. deprecated:: 3.1 Use :attr:`max_joint_velocity` instead. The cfg field is renamed so its snake_case name maps identity-style to the USD camelCase attribute (``physxJoint:maxJointVelocity``). The alias is forwarded to :attr:`max_joint_velocity` in :meth:`__post_init__` and will be - removed in 3.1. + removed in 3.2. """ +@_deprecated_schema_cfg( + "[UsdPhysicsDriveCfg(...), PhysxJointCfg(...)] (and set ensure_drives_exist on the spawner cfg)" +) @configclass class PhysxJointDrivePropertiesCfg(JointDriveBaseCfg): """PhysX-specific joint drive properties. @@ -381,6 +382,14 @@ class PhysxJointDrivePropertiesCfg(JointDriveBaseCfg): See :meth:`~isaaclab.sim.schemas.modify_joint_drive_properties` for more information. .. _PhysxJointAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/104.2/class_physx_schema_physx_joint_a_p_i.html + + .. deprecated:: 3.1 + Use :class:`PhysxJointCfg` instead, passed in the spawner's ``joint_drive_props`` slot + alongside :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` for the + ``UsdPhysics.DriveAPI`` fields (``drive_type``, ``stiffness``, ``damping`` and + ``max_force``; ``max_effort`` remains a deprecated alias of ``max_force``, as + ``max_velocity`` is of :attr:`PhysxJointCfg.max_joint_velocity`). ``ensure_drives_exist`` + is now a field on the spawner cfg. This class will be removed in 3.2. """ # ``max_joint_velocity`` on the base remains routed via ``_usd_field_exceptions`` @@ -390,28 +399,22 @@ class PhysxJointDrivePropertiesCfg(JointDriveBaseCfg): _usd_namespace: ClassVar[str | None] = "physxJoint" +@_deprecated_schema_cfg( + "[UsdPhysicsDriveCfg(...), PhysxJointCfg(...)] (and set ensure_drives_exist on the spawner cfg)" +) @configclass class JointDrivePropertiesCfg(PhysxJointDrivePropertiesCfg): - """Deprecated: use :class:`PhysxJointDrivePropertiesCfg` or :class:`~isaaclab.sim.schemas.JointDriveBaseCfg`. + """Deprecated: use the joint-drive schema fragments. - .. deprecated:: 4.6.22 - ``JointDrivePropertiesCfg`` has been split into - :class:`~isaaclab.sim.schemas.JointDriveBaseCfg` (solver-common) and - :class:`PhysxJointDrivePropertiesCfg` (PhysX-specific) and relocated to - :mod:`isaaclab_physx.sim.schemas`. This alias preserves backwards compatibility and is - scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass ``[UsdPhysicsDriveCfg(...), PhysxJointCfg(...)]`` in the spawner's + ``joint_drive_props`` slot instead: :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` + carries the ``UsdPhysics.DriveAPI`` fields and :class:`PhysxJointCfg` carries + ``max_joint_velocity``. ``ensure_drives_exist`` is now an argument of + :func:`~isaaclab.sim.schemas.apply_joint_drive_properties`. This class will be removed + in 3.2. """ - def __post_init__(self): - warnings.warn( - "'JointDrivePropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab_physx.sim.schemas.PhysxJointDrivePropertiesCfg' for PhysX properties, or" - " 'isaaclab.sim.schemas.JointDriveBaseCfg' for solver-common properties only.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - @configclass class PhysxCollisionCfg(CollisionFragment): @@ -465,6 +468,10 @@ class PhysxCollisionCfg(CollisionFragment): """Minimum radius of the contact patch for applying torsional friction [m].""" +@_deprecated_schema_cfg( + "[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...)] (and move mesh_collision_property to the" + " spawner's mesh_collision_props slot)" +) @configclass class PhysxCollisionPropertiesCfg(CollisionBaseCfg): """PhysX-specific rigid-body collision properties. @@ -481,6 +488,13 @@ class PhysxCollisionPropertiesCfg(CollisionBaseCfg): the properties and leave the rest as-is. .. _PhysxCollisionAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/104.2/class_physx_schema_physx_collision_a_p_i.html + + .. deprecated:: 3.1 + Use :class:`PhysxCollisionCfg` instead, passed in the spawner's ``collision_props`` slot + alongside :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` for ``collision_enabled``. + The nested ``mesh_collision_property`` has no fragment: pass the mesh-collision fragments + in the spawner's ``mesh_collision_props`` slot instead. This class will be removed in + 3.2. """ # PhysX torsional-friction fields below live under the ``PhysxCollisionAPI`` schema's @@ -500,6 +514,7 @@ class PhysxCollisionPropertiesCfg(CollisionBaseCfg): """Minimum radius of the contact patch for applying torsional friction [m].""" +@_deprecated_schema_cfg("[PhysxArticulationCfg(...)] (and set fix_root_link on the spawner cfg)") @configclass class PhysxArticulationRootPropertiesCfg(ArticulationRootBaseCfg): """PhysX-specific articulation-root properties. @@ -519,6 +534,14 @@ class PhysxArticulationRootPropertiesCfg(ArticulationRootBaseCfg): the properties and leave the rest as-is. .. _PhysxArticulationAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/104.2/class_physx_schema_physx_articulation_a_p_i.html + + .. deprecated:: 3.1 + Use :class:`PhysxArticulationCfg` instead, passed in the spawner's ``articulation_props`` + slot; it also carries the inherited ``articulation_enabled``. The non-USD + ``fix_root_link`` flag has no fragment: it is a field on the spawner cfg and the + ``fix_root_link`` argument of + :func:`~isaaclab.sim.schemas.apply_articulation_root_properties`. This class will be + removed in 3.2. """ # PhysX articulation-root fields below live under the ``PhysxArticulationAPI`` schema's @@ -602,57 +625,41 @@ class PhysxArticulationCfg(ArticulationRootFragment): stabilization [m²/s²].""" +@_deprecated_schema_cfg("[PhysxArticulationCfg(...)] (and set fix_root_link on the spawner cfg)") @configclass class ArticulationRootPropertiesCfg(PhysxArticulationRootPropertiesCfg): - """Deprecated: use :class:`PhysxArticulationRootPropertiesCfg` or the solver-common base class. + """Deprecated: use the articulation-root schema fragments. - Use :class:`PhysxArticulationRootPropertiesCfg` for PhysX-specific properties or - :class:`~isaaclab.sim.schemas.ArticulationRootBaseCfg` for solver-common properties only. - - .. deprecated:: 4.6.24 - ``ArticulationRootPropertiesCfg`` has been split into - :class:`~isaaclab.sim.schemas.ArticulationRootBaseCfg` (solver-common - ``fix_root_link`` and the PhysX-namespaced but IL-Newton-consumed - ``articulation_enabled``) and - :class:`PhysxArticulationRootPropertiesCfg` (PhysX-specific - self-collisions, TGS solver iter / sleep / stabilization thresholds) - and relocated to :mod:`isaaclab_physx.sim.schemas`. This alias preserves - backwards compatibility and is scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass :class:`PhysxArticulationCfg` in the spawner's ``articulation_props`` slot + instead; it carries ``articulation_enabled``, ``enabled_self_collisions`` and the TGS + solver / sleep / stabilization thresholds. The non-USD ``fix_root_link`` flag is now + the ``fix_root_link`` argument of + :func:`~isaaclab.sim.schemas.apply_articulation_root_properties`. For Newton-native + self-collision control use + :class:`~isaaclab_newton.sim.schemas.NewtonArticulationCfg`. This class will be + removed in 3.2. """ - def __post_init__(self): - warnings.warn( - "'ArticulationRootPropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab_physx.sim.schemas.PhysxArticulationRootPropertiesCfg' for PhysX properties, or" - " 'isaaclab.sim.schemas.ArticulationRootBaseCfg' for solver-common properties only.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - +@_deprecated_schema_cfg( + "[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...)] (and move mesh_collision_property to the" + " spawner's mesh_collision_props slot)" +) @configclass class CollisionPropertiesCfg(PhysxCollisionPropertiesCfg): - """Deprecated: use :class:`PhysxCollisionPropertiesCfg` or :class:`~isaaclab.sim.schemas.CollisionBaseCfg`. + """Deprecated: use the collision schema fragments. - .. deprecated:: 4.6.23 - ``CollisionPropertiesCfg`` has been split into - :class:`~isaaclab.sim.schemas.CollisionBaseCfg` (solver-common) and - :class:`PhysxCollisionPropertiesCfg` (PhysX-specific) and relocated to - :mod:`isaaclab_physx.sim.schemas`. This alias preserves backwards compatibility and is - scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass ``[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...)]`` in the spawner's + ``collision_props`` slot instead: + :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` carries ``collision_enabled`` + and :class:`PhysxCollisionCfg` the ``physxCollision:*`` offsets and torsional-patch + fields. The nested ``mesh_collision_property`` has no fragment: pass the mesh-collision + fragments in the spawner's ``mesh_collision_props`` slot instead. This class will be + removed in 3.2. """ - def __post_init__(self): - warnings.warn( - "'CollisionPropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab_physx.sim.schemas.PhysxCollisionPropertiesCfg' for PhysX properties, or" - " 'isaaclab.sim.schemas.CollisionBaseCfg' for solver-common properties only.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - # ------------------------------------------------------------------------------------- # Mesh-collision cooking fragments (single-namespace; PhysX cooking add-on schemas). @@ -819,6 +826,7 @@ class PhysxSDFMeshCfg(MeshCollisionFragment): """ +@_deprecated_schema_cfg("[PhysxConvexHullCfg(...)]") @configclass class PhysxConvexHullPropertiesCfg(MeshCollisionBaseCfg): """PhysX convex-hull cooking properties for a mesh collider. @@ -832,6 +840,10 @@ class PhysxConvexHullPropertiesCfg(MeshCollisionBaseCfg): Original PhysX Documentation: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_physx_schema_physx_convex_hull_collision_a_p_i.html + + .. deprecated:: 3.1 + Use :class:`PhysxConvexHullCfg` instead, passed in the spawner's ``mesh_collision_props`` + slot. This class will be removed in 3.2. """ _usd_applied_schema: ClassVar[str | None] = "PhysxConvexHullCollisionAPI" @@ -852,6 +864,7 @@ class PhysxConvexHullPropertiesCfg(MeshCollisionBaseCfg): """ +@_deprecated_schema_cfg("[PhysxConvexDecompositionCfg(...)]") @configclass class PhysxConvexDecompositionPropertiesCfg(MeshCollisionBaseCfg): """PhysX convex-decomposition cooking properties for a mesh collider. @@ -860,6 +873,10 @@ class PhysxConvexDecompositionPropertiesCfg(MeshCollisionBaseCfg): Original PhysX Documentation: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_physx_schema_physx_convex_decomposition_collision_a_p_i.html + + .. deprecated:: 3.1 + Use :class:`PhysxConvexDecompositionCfg` instead, passed in the spawner's + ``mesh_collision_props`` slot. This class will be removed in 3.2. """ _usd_applied_schema: ClassVar[str | None] = "PhysxConvexDecompositionCollisionAPI" @@ -900,6 +917,7 @@ class PhysxConvexDecompositionPropertiesCfg(MeshCollisionBaseCfg): """ +@_deprecated_schema_cfg("[PhysxTriangleMeshCfg(...)]") @configclass class PhysxTriangleMeshPropertiesCfg(MeshCollisionBaseCfg): """PhysX triangle-mesh cooking properties for a mesh collider. @@ -910,6 +928,10 @@ class PhysxTriangleMeshPropertiesCfg(MeshCollisionBaseCfg): Original PhysX Documentation: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_physx_schema_physx_triangle_mesh_collision_a_p_i.html + + .. deprecated:: 3.1 + Use :class:`PhysxTriangleMeshCfg` instead, passed in the spawner's + ``mesh_collision_props`` slot. This class will be removed in 3.2. """ _usd_applied_schema: ClassVar[str | None] = "PhysxTriangleMeshCollisionAPI" @@ -926,6 +948,7 @@ class PhysxTriangleMeshPropertiesCfg(MeshCollisionBaseCfg): """ +@_deprecated_schema_cfg("[PhysxTriangleMeshSimplificationCfg(...)]") @configclass class PhysxTriangleMeshSimplificationPropertiesCfg(MeshCollisionBaseCfg): """PhysX triangle-mesh-simplification cooking properties for a mesh collider. @@ -934,6 +957,10 @@ class PhysxTriangleMeshSimplificationPropertiesCfg(MeshCollisionBaseCfg): Original PhysX Documentation: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_physx_schema_physx_triangle_mesh_simplification_collision_a_p_i.html + + .. deprecated:: 3.1 + Use :class:`PhysxTriangleMeshSimplificationCfg` instead, passed in the spawner's + ``mesh_collision_props`` slot. This class will be removed in 3.2. """ _usd_applied_schema: ClassVar[str | None] = "PhysxTriangleMeshSimplificationCollisionAPI" @@ -955,6 +982,7 @@ class PhysxTriangleMeshSimplificationPropertiesCfg(MeshCollisionBaseCfg): """ +@_deprecated_schema_cfg("[PhysxSDFMeshCfg(...)]") @configclass class PhysxSDFMeshPropertiesCfg(MeshCollisionBaseCfg): """PhysX SDF-mesh cooking properties for a mesh collider. @@ -968,6 +996,10 @@ class PhysxSDFMeshPropertiesCfg(MeshCollisionBaseCfg): More details and steps for optimizing SDF results can be found here: https://nvidia-omniverse.github.io/PhysX/physx/5.2.1/docs/RigidBodyCollision.html#dynamic-triangle-meshes-with-sdfs + + .. deprecated:: 3.1 + Use :class:`PhysxSDFMeshCfg` instead, passed in the spawner's ``mesh_collision_props`` + slot. This class will be removed in 3.2. """ _usd_applied_schema: ClassVar[str | None] = "PhysxSDFMeshCollisionAPI" @@ -1020,122 +1052,80 @@ class PhysxSDFMeshPropertiesCfg(MeshCollisionBaseCfg): """ +@_deprecated_schema_cfg("[UsdPhysicsMeshCollisionCfg(...)]") @configclass class MeshCollisionPropertiesCfg(MeshCollisionBaseCfg): - """Deprecated: use :class:`~isaaclab.sim.schemas.MeshCollisionBaseCfg`. + """Deprecated: use :class:`~isaaclab.sim.schemas.UsdPhysicsMeshCollisionCfg`. - .. deprecated:: 4.6.25 - ``MeshCollisionPropertiesCfg`` was the flat (non-leaf) base of the legacy - mesh-collision cfg family. It has been renamed to - :class:`~isaaclab.sim.schemas.MeshCollisionBaseCfg` to match the rest of the - consumption-gated split. This alias preserves backwards compatibility and is - scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass :class:`~isaaclab.sim.schemas.UsdPhysicsMeshCollisionCfg` in the spawner's + ``mesh_collision_props`` slot instead; it carries the ``physics:approximation`` token. + Add a cooking fragment (:class:`PhysxConvexHullCfg`, + :class:`PhysxConvexDecompositionCfg`, :class:`PhysxTriangleMeshCfg`, + :class:`PhysxTriangleMeshSimplificationCfg` or :class:`PhysxSDFMeshCfg`) for the + matching PhysX cooking tunables. This class will be removed in 3.2. """ - def __post_init__(self): - warnings.warn( - "'MeshCollisionPropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab.sim.schemas.MeshCollisionBaseCfg' instead.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - +@_deprecated_schema_cfg("[PhysxConvexHullCfg(...)]") @configclass class ConvexHullPropertiesCfg(PhysxConvexHullPropertiesCfg): - """Deprecated: use :class:`PhysxConvexHullPropertiesCfg`. + """Deprecated: use :class:`PhysxConvexHullCfg`. - .. deprecated:: 4.6.25 - Renamed and relocated. This alias preserves backwards compatibility and is - scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass :class:`PhysxConvexHullCfg` in the spawner's ``mesh_collision_props`` slot instead; its default + approximation token replaces the legacy ``mesh_approximation_name`` string. This class + will be removed in 3.2. """ - def __post_init__(self): - warnings.warn( - "'ConvexHullPropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab_physx.sim.schemas.PhysxConvexHullPropertiesCfg' instead.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - +@_deprecated_schema_cfg("[PhysxConvexDecompositionCfg(...)]") @configclass class ConvexDecompositionPropertiesCfg(PhysxConvexDecompositionPropertiesCfg): - """Deprecated: use :class:`PhysxConvexDecompositionPropertiesCfg`. + """Deprecated: use :class:`PhysxConvexDecompositionCfg`. - .. deprecated:: 4.6.25 - Renamed and relocated. This alias preserves backwards compatibility and is - scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass :class:`PhysxConvexDecompositionCfg` in the spawner's ``mesh_collision_props`` slot instead; its default + approximation token replaces the legacy ``mesh_approximation_name`` string. This class + will be removed in 3.2. """ - def __post_init__(self): - warnings.warn( - "'ConvexDecompositionPropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab_physx.sim.schemas.PhysxConvexDecompositionPropertiesCfg' instead.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - +@_deprecated_schema_cfg("[PhysxTriangleMeshCfg(...)]") @configclass class TriangleMeshPropertiesCfg(PhysxTriangleMeshPropertiesCfg): - """Deprecated: use :class:`PhysxTriangleMeshPropertiesCfg`. + """Deprecated: use :class:`PhysxTriangleMeshCfg`. - .. deprecated:: 4.6.25 - Renamed and relocated. This alias preserves backwards compatibility and is - scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass :class:`PhysxTriangleMeshCfg` in the spawner's ``mesh_collision_props`` slot instead; its default + approximation token replaces the legacy ``mesh_approximation_name`` string. This class + will be removed in 3.2. """ - def __post_init__(self): - warnings.warn( - "'TriangleMeshPropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab_physx.sim.schemas.PhysxTriangleMeshPropertiesCfg' instead.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - +@_deprecated_schema_cfg("[PhysxTriangleMeshSimplificationCfg(...)]") @configclass class TriangleMeshSimplificationPropertiesCfg(PhysxTriangleMeshSimplificationPropertiesCfg): - """Deprecated: use :class:`PhysxTriangleMeshSimplificationPropertiesCfg`. + """Deprecated: use :class:`PhysxTriangleMeshSimplificationCfg`. - .. deprecated:: 4.6.25 - Renamed and relocated. This alias preserves backwards compatibility and is - scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass :class:`PhysxTriangleMeshSimplificationCfg` in the spawner's ``mesh_collision_props`` + slot instead; its default approximation token replaces the legacy + ``mesh_approximation_name`` string. This class will be removed in 3.2. """ - def __post_init__(self): - warnings.warn( - "'TriangleMeshSimplificationPropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab_physx.sim.schemas.PhysxTriangleMeshSimplificationPropertiesCfg' instead.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - +@_deprecated_schema_cfg("[PhysxSDFMeshCfg(...)]") @configclass class SDFMeshPropertiesCfg(PhysxSDFMeshPropertiesCfg): - """Deprecated: use :class:`PhysxSDFMeshPropertiesCfg`. + """Deprecated: use :class:`PhysxSDFMeshCfg`. - .. deprecated:: 4.6.25 - Renamed and relocated. This alias preserves backwards compatibility and is - scheduled for removal in 4.0. + .. deprecated:: 3.1 + Pass :class:`PhysxSDFMeshCfg` in the spawner's ``mesh_collision_props`` slot instead; its default + approximation token replaces the legacy ``mesh_approximation_name`` string. This class + will be removed in 3.2. """ - def __post_init__(self): - warnings.warn( - "'SDFMeshPropertiesCfg' is deprecated and will be removed in 3.1. Use" - " 'isaaclab_physx.sim.schemas.PhysxSDFMeshPropertiesCfg' instead.", - DeprecationWarning, - stacklevel=2, - ) - super().__post_init__() - @configclass class PhysxFixedTendonPropertiesCfg: @@ -1187,7 +1177,7 @@ class PhysxFixedTendonPropertiesCfg: class FixedTendonPropertiesCfg(PhysxFixedTendonPropertiesCfg): """Deprecated: use :class:`PhysxFixedTendonPropertiesCfg`. - .. deprecated:: 4.6.x + .. deprecated:: 3.1 ``FixedTendonPropertiesCfg`` was relocated to :mod:`isaaclab_physx.sim.schemas` and renamed to :class:`PhysxFixedTendonPropertiesCfg`. The legacy name remains as a @@ -1196,7 +1186,7 @@ class FixedTendonPropertiesCfg(PhysxFixedTendonPropertiesCfg): def __post_init__(self): warnings.warn( - "'FixedTendonPropertiesCfg' is deprecated and will be removed in 3.1. Use" + "'FixedTendonPropertiesCfg' is deprecated and will be removed in 3.2. Use" " 'isaaclab_physx.sim.schemas.PhysxFixedTendonPropertiesCfg' instead.", DeprecationWarning, stacklevel=2, @@ -1245,7 +1235,7 @@ class PhysxSpatialTendonPropertiesCfg: class SpatialTendonPropertiesCfg(PhysxSpatialTendonPropertiesCfg): """Deprecated: use :class:`PhysxSpatialTendonPropertiesCfg`. - .. deprecated:: 4.6.x + .. deprecated:: 3.1 ``SpatialTendonPropertiesCfg`` was relocated to :mod:`isaaclab_physx.sim.schemas` and renamed to :class:`PhysxSpatialTendonPropertiesCfg`. The legacy name remains as a @@ -1254,7 +1244,7 @@ class SpatialTendonPropertiesCfg(PhysxSpatialTendonPropertiesCfg): def __post_init__(self): warnings.warn( - "'SpatialTendonPropertiesCfg' is deprecated and will be removed in 3.1. Use" + "'SpatialTendonPropertiesCfg' is deprecated and will be removed in 3.2. Use" " 'isaaclab_physx.sim.schemas.PhysxSpatialTendonPropertiesCfg' instead.", DeprecationWarning, stacklevel=2, diff --git a/source/isaaclab_physx/isaaclab_physx/sim/spawners/materials/physics_materials_cfg.py b/source/isaaclab_physx/isaaclab_physx/sim/spawners/materials/physics_materials_cfg.py index d468e2a152c7..148c852aac9c 100644 --- a/source/isaaclab_physx/isaaclab_physx/sim/spawners/materials/physics_materials_cfg.py +++ b/source/isaaclab_physx/isaaclab_physx/sim/spawners/materials/physics_materials_cfg.py @@ -113,7 +113,7 @@ class PhysxSurfaceDeformableBodyMaterialCfg( class DeformableBodyMaterialCfg(PhysxDeformableBodyMaterialCfg): """Deprecated: use :class:`PhysxDeformableBodyMaterialCfg`. - .. deprecated:: 4.6.x + .. deprecated:: 3.1 ``DeformableBodyMaterialCfg`` has moved to :class:`PhysxDeformableBodyMaterialCfg` for PhysX-specific deformable materials and is scheduled for removal in 4.0. @@ -121,7 +121,7 @@ class DeformableBodyMaterialCfg(PhysxDeformableBodyMaterialCfg): def __post_init__(self): warnings.warn( - "'DeformableBodyMaterialCfg' is deprecated and will be removed in 3.1. Use" + "'DeformableBodyMaterialCfg' is deprecated and will be removed in 3.2. Use" " 'isaaclab_physx.sim.spawners.materials.PhysxDeformableBodyMaterialCfg' instead.", DeprecationWarning, stacklevel=2, @@ -133,7 +133,7 @@ def __post_init__(self): class SurfaceDeformableBodyMaterialCfg(PhysxSurfaceDeformableBodyMaterialCfg): """Deprecated: use :class:`PhysxSurfaceDeformableBodyMaterialCfg`. - .. deprecated:: 4.6.x + .. deprecated:: 3.1 ``SurfaceDeformableBodyMaterialCfg`` has moved to :class:`PhysxSurfaceDeformableBodyMaterialCfg` for PhysX-specific surface deformable materials and is scheduled for removal in 4.0. @@ -141,7 +141,7 @@ class SurfaceDeformableBodyMaterialCfg(PhysxSurfaceDeformableBodyMaterialCfg): def __post_init__(self): warnings.warn( - "'SurfaceDeformableBodyMaterialCfg' is deprecated and will be removed in 3.1. Use" + "'SurfaceDeformableBodyMaterialCfg' is deprecated and will be removed in 3.2. Use" " 'isaaclab_physx.sim.spawners.materials.PhysxSurfaceDeformableBodyMaterialCfg' instead.", DeprecationWarning, stacklevel=2, @@ -286,7 +286,7 @@ class RigidBodyMaterialCfg(PhysxRigidBodyMaterialCfg): """Deprecated: use :class:`PhysxRigidBodyMaterialCfg` or :class:`~isaaclab.sim.spawners.materials.RigidBodyMaterialBaseCfg`. - .. deprecated:: 4.6.22 + .. deprecated:: 3.1 ``RigidBodyMaterialCfg`` has been split into :class:`~isaaclab.sim.spawners.materials.RigidBodyMaterialBaseCfg` (solver-common) and :class:`PhysxRigidBodyMaterialCfg` (PhysX-specific) and relocated to @@ -296,7 +296,7 @@ class RigidBodyMaterialCfg(PhysxRigidBodyMaterialCfg): def __post_init__(self): warnings.warn( - "'RigidBodyMaterialCfg' is deprecated and will be removed in 3.1. Use" + "'RigidBodyMaterialCfg' is deprecated and will be removed in 3.2. Use" " 'isaaclab_physx.sim.spawners.materials.PhysxRigidBodyMaterialCfg' for PhysX" " properties, or 'isaaclab.sim.spawners.materials.RigidBodyMaterialBaseCfg' for" " solver-common properties only.",