Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/source/api/lab/isaaclab.sim.schemas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ isaaclab.sim.schemas
UsdPhysicsDriveCfg
UsdPhysicsMeshCollisionCfg
MassCfg
DeformableBodyFragment
OmniPhysicsDeformableBodyCfg

.. rubric:: Fragment writers

Expand All @@ -70,6 +72,8 @@ isaaclab.sim.schemas
apply_namespaced
apply_drive
apply_mesh_collision
apply_volume_deformable_properties
apply_surface_deformable_properties

.. rubric:: Functions

Expand Down Expand Up @@ -164,6 +168,16 @@ Schema Fragments
:show-inheritance:
:exclude-members: __init__

.. autoclass:: DeformableBodyFragment
:members:
:show-inheritance:
:exclude-members: __init__

.. autoclass:: OmniPhysicsDeformableBodyCfg
:members:
:show-inheritance:
:exclude-members: __init__

.. autofunction:: apply_rigid_body_properties
.. autofunction:: apply_collision_properties
.. autofunction:: apply_mass_properties
Expand All @@ -175,6 +189,8 @@ Schema Fragments
.. autofunction:: apply_namespaced
.. autofunction:: apply_drive
.. autofunction:: apply_mesh_collision
.. autofunction:: apply_volume_deformable_properties
.. autofunction:: apply_surface_deformable_properties

Articulation Root
-----------------
Expand Down
20 changes: 20 additions & 0 deletions docs/source/api/lab/isaaclab.sim.spawners.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ Materials
RigidBodyMaterialFragment
UsdPhysicsRigidBodyMaterialCfg
RigidBodyMaterialCfg
DeformableMaterialFragment
OmniPhysicsDeformableMaterialCfg
OmniPhysicsSurfaceDeformableMaterialCfg
DeformableBodyMaterialBaseCfg
SurfaceDeformableBodyMaterialBaseCfg
DeformableBodyMaterialCfg
Expand Down Expand Up @@ -354,6 +357,8 @@ Physical Materials
:show-inheritance:
:exclude-members: __init__, func

.. autofunction:: spawn_physics_material_from_fragments

.. autofunction:: spawn_rigid_body_material_from_fragments

.. autoclass:: RigidBodyMaterialFragment
Expand All @@ -370,6 +375,21 @@ Physical Materials
:members:
:exclude-members: __init__, func

.. autoclass:: DeformableMaterialFragment
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autoclass:: OmniPhysicsDeformableMaterialCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autoclass:: OmniPhysicsSurfaceDeformableMaterialCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autofunction:: spawn_deformable_body_material

.. autoclass:: DeformableBodyMaterialBaseCfg
Expand Down
12 changes: 12 additions & 0 deletions docs/source/api/lab_newton/isaaclab_newton.sim.spawners.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ isaaclab_newton.sim.spawners
.. autosummary::

NewtonMaterialCfg
NewtonVolumeDeformableMaterialCfg
NewtonSurfaceDeformableMaterialCfg
NewtonDeformableBodyMaterialCfg
NewtonDeformableMaterialCfg
NewtonSurfaceDeformableBodyMaterialCfg
Expand All @@ -26,6 +28,16 @@ Deformable Materials
Newton provides the backend-specific deformable material cfgs. Deformable material spawning is unified in
:func:`isaaclab.sim.spawners.materials.spawn_deformable_body_material`.

.. autoclass:: NewtonVolumeDeformableMaterialCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autoclass:: NewtonSurfaceDeformableMaterialCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autoclass:: NewtonDeformableBodyMaterialCfg
:members:
:show-inheritance:
Expand Down
12 changes: 12 additions & 0 deletions docs/source/api/lab_physx/isaaclab_physx.sim.schemas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ isaaclab_physx.sim.schemas

OmniPhysicsDeformableBodyPropertiesCfg
PhysxDeformableBodyPropertiesCfg
PhysxDeformableBodyCfg
PhysxSurfaceDeformableBodyCfg
DeformableBodyPropertiesCfg

.. rubric:: Functions
Expand Down Expand Up @@ -166,6 +168,16 @@ Deformable Body
:show-inheritance:
:exclude-members: __init__

.. autoclass:: PhysxDeformableBodyCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autoclass:: PhysxSurfaceDeformableBodyCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autoclass:: DeformableBodyPropertiesCfg
:members:
:show-inheritance:
Expand Down
12 changes: 12 additions & 0 deletions docs/source/api/lab_physx/isaaclab_physx.sim.spawners.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ isaaclab_physx.sim.spawners

PhysxRigidBodyMaterialCfg
PhysxMaterialCfg
PhysxDeformableMaterialCfg
PhysxSurfaceDeformableMaterialCfg
PhysxDeformableBodyMaterialCfg
PhysxSurfaceDeformableBodyMaterialCfg
PhysXDeformableMaterialCfg
Expand All @@ -33,6 +35,16 @@ Deformable Materials
PhysX provides the backend-specific deformable material cfgs. Deformable material spawning is unified in
:func:`isaaclab.sim.spawners.materials.spawn_deformable_body_material`.

.. autoclass:: PhysxDeformableMaterialCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autoclass:: PhysxSurfaceDeformableMaterialCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autoclass:: PhysxDeformableBodyMaterialCfg
:members:
:show-inheritance:
Expand Down
92 changes: 91 additions & 1 deletion docs/source/concepts/schema_fragments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,17 @@ imports a backend:
* - ``spatial_tendons_props``
- :func:`~isaaclab.sim.schemas.apply_spatial_tendon_properties`
- tendon attachment root prims
* - ``volume_deformable_props``
- :func:`~isaaclab.sim.schemas.apply_volume_deformable_properties`
- volume deformable-body prims (``UsdGeom.TetMesh`` simulation mesh)
* - ``surface_deformable_props``
- :func:`~isaaclab.sim.schemas.apply_surface_deformable_properties`
- surface deformable-body prims (triangle-mesh simulation mesh)

The tendon families are *tune-not-apply*: the tendon topology is authored in the source
asset, so their writers only tune existing instances and never create them. PhysX tendon
asset, so their writers only tune existing instances and never create them. The deformable
families sit at the other end of that spectrum: see :ref:`schema-fragments-deformable`.
PhysX tendon
fragments use ``instance_names`` to select one or more instances on each matching prim;
``None`` (the default) broadcasts to all existing instances.

Expand Down Expand Up @@ -205,6 +213,88 @@ receives the API, so a too-broad pattern can, for example, give every mesh in a
its own mass. Which bodies participate in an articulation is still decided by the
asset's joints, not by the expression. Scope creation patterns deliberately.

.. _schema-fragments-deformable:

Deformable bodies
------------------

The deformable families invert the "modify existing" default: the
``volume_deformable_props`` / ``surface_deformable_props`` writers
(:func:`~isaaclab.sim.schemas.apply_volume_deformable_properties` /
:func:`~isaaclab.sim.schemas.apply_surface_deformable_properties`) always create a full
deformable-body setup on a matched prim that lacks one, with no opt-in flag to set. Fragments
for both slots subclass :class:`~isaaclab.sim.schemas.DeformableBodyFragment`; the
core-owned :class:`~isaaclab.sim.schemas.OmniPhysicsDeformableBodyCfg` carries the
solver-common fields (``deformable_body_enabled``, ``kinematic_enabled``, ``mass``). PhysX
adds its own body-tuning fragments (``PhysxDeformableBodyCfg`` for shared solver/damping
attributes, ``PhysxSurfaceDeformableBodyCfg`` narrowed to surface deformables) in
:mod:`isaaclab_physx.sim.schemas`. Newton needs no additional body fragment.

At most one of the two slots may be set on a spawner: a mesh is spawned as either a volume
deformable (tetrahedralized interior) or a surface deformable (cloth-like), never both. The
slot's mapping keys are regular-expression suffixes appended to the *spawn* prim — unlike the
other families, this holds for every spawner type, including shape and mesh spawners whose other
families anchor at the geometry or container prim instead. The empty string ``""`` again
selects the spawn prim itself, and ``"(/.*)?"`` selects it together with its subtree.

Creating the deformable setup on a matched prim without the anchor happens in three steps:

#. **Simulation mesh.** A ``sim_mesh`` child prim is authored under the target (the name is
configurable via the writer's ``sim_mesh_name`` argument). For surface deformables this is
a triangle-mesh copy of the visual mesh; for volume deformables it is a tetrahedralized
``UsdGeom.TetMesh`` — reused in place, without re-tetrahedralizing, when the source asset
already ships a pre-tetrahedralized ``UsdGeom.TetMesh`` child.
#. **Backend anchor.** The active physics backend applies its own anchor schemas through
``PhysicsManager.setup_deformable_body``: PhysX applies the real ``OmniPhysicsDeformableBodyAPI``
to the body prim (the same single schema for both deformable types) and the type-dependent
``OmniPhysicsVolumeDeformableSimAPI`` / ``OmniPhysicsSurfaceDeformableSimAPI`` to the
simulation-mesh prim, while Newton applies its own (currently token-only) ``Physics*`` schemas.
Core fragments own no applied schema of their own —
:class:`~isaaclab.sim.schemas.OmniPhysicsDeformableBodyCfg` only writes into the
``omniphysics:*`` namespace once the anchor exists.
#. **Fragment dispatch.** Every fragment in the matched slot is applied to the target, in list
order, exactly like the other families.

``UsdPhysics.MassAPI`` is not honored for deformables: set mass through
:attr:`~isaaclab.sim.schemas.OmniPhysicsDeformableBodyCfg.mass` instead.

Because the simulation mesh already carries ``UsdPhysics.CollisionAPI`` once created, its
collision offsets ride the existing collision family rather than a deformable-specific one:
key ``collision_props`` to the simulation-mesh child (``"/sim_mesh"`` by default),
anchored the same way as the deformable slot itself, relative to the spawn prim.

Physics materials widen the same way: ``physics_material`` accepts deformable material
fragments (subclasses of ``DeformableMaterialFragment`` in
:mod:`isaaclab.sim.spawners.materials`, e.g. ``OmniPhysicsDeformableMaterialCfg`` /
``OmniPhysicsSurfaceDeformableMaterialCfg``) and mixed lists that combine a rigid-body
material fragment with a deformable one. The ``UsdPhysics.MaterialAPI`` anchor is applied
only when the list contains a rigid-body material fragment; deformable material fragments
apply their own schema (e.g. ``OmniPhysicsDeformableMaterialAPI``) independently, since a
material prim bound only to deformable bodies has no rigid-body material semantics to anchor.

A cuboid mesh spawned as a volume deformable, with PhysX solver tuning, a collision offset on
the simulation mesh, and a mixed PhysX/Newton material:

.. code-block:: python

import isaaclab.sim as sim_utils
from isaaclab_physx.sim.schemas import PhysxCollisionCfg, PhysxDeformableBodyCfg
from isaaclab.sim.spawners.materials import OmniPhysicsDeformableMaterialCfg
from isaaclab_newton.sim.spawners.materials import NewtonVolumeDeformableMaterialCfg

sim_utils.MeshCuboidCfg(
size=(0.2, 0.2, 0.2),
volume_deformable_props=[
sim_utils.schemas.OmniPhysicsDeformableBodyCfg(mass=0.5),
PhysxDeformableBodyCfg(solver_position_iteration_count=32),
],
collision_props={"/sim_mesh": [PhysxCollisionCfg(contact_offset=0.01)]},
physics_material=[
OmniPhysicsDeformableMaterialCfg(youngs_modulus=1.0e6, poissons_ratio=0.45),
NewtonVolumeDeformableMaterialCfg(k_mu=1.0e5),
],
)

See also
--------

Expand Down
25 changes: 16 additions & 9 deletions docs/source/concepts/sensors/contact_sensor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,20 @@ Enable optional buffers only when they are needed. Their backend support differs

* Isaac Sim PhysX supports pose, filtered contact-point, and filtered friction-force
tracking, but not aggregate friction-force tracking.
* OvPhysX supports pose tracking for a single sensor body per environment, but not contact-point or
friction-force tracking.
* OvPhysX supports filtered contact-point and filtered friction-force tracking, but not aggregate
friction-force tracking. Pose tracking is supported for a single sensor body per environment.
* Newton supports filtered contact-point and aggregate or filtered friction-force tracking, but not
pose tracking.

Filtered contact points and friction-force matrices require filters. Contact-rich Isaac
Sim PhysX scenes may require a larger ``max_contact_data_count_per_prim``.
Filtered contact points and friction-force matrices require filters. Isaac Sim PhysX and OvPhysX
require a positive ``max_contact_data_count_per_prim`` for these features. Contact-rich scenes may
require a larger value. OvPhysX warns and truncates detailed contacts when capacity is exceeded;
increase the configured capacity before recreating the sensor to retain all contacts.

Contact positions are averaged over each sensor/filter pair and are ``NaN`` when the pair has no
contacts. OvPhysX also resets contact positions to ``NaN``. Filtered friction forces sum the pair's
friction forces and are zero without contact. On PhysX and OvPhysX, contact points and friction
anchors can have different counts.

Read the data
-------------
Expand Down Expand Up @@ -108,19 +115,19 @@ principal Torch views have these contracts:
- Normal force [N] from each filtered partner
* - ``friction_force_matrix_w.torch``
- ``(E, S, F, 3)``
- Friction force [N] from each filtered partner; Isaac Sim PhysX and Newton
- Friction force [N] from each filtered partner; Isaac Sim PhysX, OvPhysX, and Newton
* - ``contact_pos_w.torch``
- ``(E, S, F, 3)``
- Average filtered contact position [m] in world frame; unavailable on OvPhysX
- Average filtered contact position [m] in world frame
* - ``current_air_time.torch`` / ``current_contact_time.torch``
- ``(E, S)``
- Current mode duration [s]

Supported optional buffers are ``None`` unless their matching tracking option or filter is enabled.
Normal and friction force histories follow the same shapes with an added ``H`` dimension.
OvPhysX rejects unsupported tracking options during initialization. Reading aggregate friction on
PhysX or OvPhysX raises ``NotImplementedError``. The compatibility alias ``friction_forces_w``
returns the aggregate on Newton; on PhysX it returns ``friction_force_matrix_w`` with a warning.
Reading aggregate friction on PhysX or OvPhysX raises ``NotImplementedError``. The compatibility
alias ``friction_forces_w`` returns the aggregate on Newton; on PhysX and OvPhysX it returns
``friction_force_matrix_w`` with a warning.
Reading pose data on Newton raises ``NotImplementedError``.

.. code-block:: python
Expand Down
11 changes: 5 additions & 6 deletions scripts/benchmarks/nsys_trace.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,12 @@
"functions": [
"OVRTXRenderer.prepare_stage",
"OVRTXRenderer.create_render_data",
"OVRTXRenderer._clone_sources_in_ovrtx",
"OVRTXRenderer._clone_sources_ovstage",
"OVRTXRenderer._clone_sources",
"OVRTXRenderer._update_scene_partitions_after_clone",
"OVRTXRenderer._update_scene_partitions_after_clone_ovstage",
"OVRTXRenderer._setup_xform_bindings",
"OVRTXRenderer._setup_deformable_bindings",
"OVRTXRenderer._setup_particle_bindings",
"OVRTXRenderer._setup_xform_bindings_legacy",
"OVRTXRenderer._setup_xform_bindings_ovstage",
"OVRTXRenderer._setup_geometry_bindings_legacy",
"OVRTXRenderer._setup_geometry_bindings_ovstage",
"OVRTXRenderer.update_transforms",
"OVRTXRenderer.update_geometries",
"OVRTXRenderer.update_camera",
Expand Down
47 changes: 47 additions & 0 deletions source/isaaclab/changelog.d/vidurv-deformable-fragments.minor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Added
^^^^^

* Added the deformable-body fragment families: :class:`~isaaclab.sim.schemas.DeformableBodyFragment`
and :class:`~isaaclab.sim.schemas.OmniPhysicsDeformableBodyCfg` with the expression-targeted
writers :func:`~isaaclab.sim.schemas.apply_volume_deformable_properties` and
:func:`~isaaclab.sim.schemas.apply_surface_deformable_properties`.
* Added deformable material fragments
(:class:`~isaaclab.sim.spawners.materials.OmniPhysicsDeformableMaterialCfg`,
:class:`~isaaclab.sim.spawners.materials.OmniPhysicsSurfaceDeformableMaterialCfg`) under the new
:class:`~isaaclab.sim.spawners.materials.DeformableMaterialFragment` marker, accepted by the
``physics_material`` spawner fields.
* Added ``volume_deformable_props`` and ``surface_deformable_props`` mappings to
:class:`~isaaclab.sim.spawners.DeformableObjectSpawnerCfg`, applying deformable fragments by
target pattern relative to the spawn prim. A bare fragment or list is shorthand for the spawn
prim itself. Alongside either slot, ``collision_props`` must be given as collision fragments; a
legacy collision cfg raises, since it cannot reach the simulation mesh.
* Added :meth:`~isaaclab.physics.PhysicsManager.setup_deformable_body` so each physics backend
applies its own deformable anchor schemas.
* Added ``tetrahedralization_edge_length_fac`` to
:func:`~isaaclab.sim.schemas.apply_volume_deformable_properties`, so the volume fragment writer
controls the automatic tetrahedralization target edge length like
:func:`~isaaclab.sim.schemas.define_deformable_body_properties` does.

Changed
^^^^^^^

* Changed :attr:`~isaaclab.sim.spawners.meshes.MeshCfg.edge_refinement` to apply to the
``volume_deformable_props`` and ``surface_deformable_props`` slots as well, not only the legacy
``deformable_props`` field.
* Changed physics-material fragment lists to allow mixing rigid-body and deformable material
fragments on one material prim; the ``UsdPhysics.MaterialAPI`` anchor is applied only when a
rigid-body fragment is present. The writer is now named
:func:`~isaaclab.sim.spawners.materials.spawn_physics_material_from_fragments` accordingly.
* Changed :func:`~isaaclab.sim.schemas.apply_volume_deformable_properties` and
:func:`~isaaclab.sim.schemas.apply_surface_deformable_properties` to skip matched prims that are
already authored as the other deformable type. Such a prim is reported with a warning and drags
the return value to ``False`` instead of receiving a family it does not simulate with. Target the
prim through the writer matching its authored type.

Deprecated
^^^^^^^^^^

* Deprecated :func:`~isaaclab.sim.spawners.materials.spawn_rigid_body_material_from_fragments` in
favor of :func:`~isaaclab.sim.spawners.materials.spawn_physics_material_from_fragments`, which
also accepts deformable material fragments. The old name still forwards to the new writer and
emits a ``DeprecationWarning``; it is scheduled for removal in 3.2.
Loading
Loading