Unverified Commit c372ae93 authored by ooctipus's avatar ooctipus Committed by GitHub

Exposes `physxscene:solveArticulationContactLast` flag through PhysxCfg (#3502)

# Description

This PR adds api to set physxscene:solveArticulationContactLast through
PhysxCfg,
this is only available in sim 5.1

Fixes # (issue)

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- New feature (non-breaking change which adds functionality)

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->

---------
Signed-off-by: 's avatarooctipus <zhengyuz@nvidia.com>
Co-authored-by: 's avatarMayank Mittal <12863862+Mayankm96@users.noreply.github.com>
parent 2d80bd86
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.46.4" version = "0.46.5"
# Description # Description
title = "Isaac Lab framework for Robot Learning" title = "Isaac Lab framework for Robot Learning"
......
Changelog Changelog
--------- ---------
0.46.5 (2025-10-14)
~~~~~~~~~~~~~~~~~~~
* Exposed parameter :attr:`~isaaclab.sim.spawners.PhysxCfg.solve_articulation_contact_last`
to configure USD attribute ``physxscene:solveArticulationContactLast``. This parameter may
help improve solver stability with grippers, which previously required reducing simulation time-steps.
:class:`~isaaclab.sim.spawners.PhysxCfg`
0.46.4 (2025-10-06) 0.46.4 (2025-10-06)
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
......
...@@ -160,6 +160,26 @@ class PhysxCfg: ...@@ -160,6 +160,26 @@ class PhysxCfg:
gpu_max_particle_contacts: int = 2**20 gpu_max_particle_contacts: int = 2**20
"""Size of particle contacts stream buffer allocated in pinned host memory. Default is 2 ** 20.""" """Size of particle contacts stream buffer allocated in pinned host memory. Default is 2 ** 20."""
solve_articulation_contact_last: bool = False
"""Changes the ordering inside the articulation solver. Default is False.
PhysX employs a strict ordering for handling constraints in an articulation. The outcome of
each constraint resolution modifies the joint and associated link speeds. However, the default
ordering may not be ideal for gripping scenarios because the solver favours the constraint
types that are resolved last. This is particularly true of stiff constraint systems that are hard
to resolve without resorting to vanishingly small simulation timesteps.
With dynamic contact resolution being such an important part of gripping, it may make
more sense to solve dynamic contact towards the end of the solver rather than at the
beginning. This parameter modifies the default ordering to enable this change.
For more information, please check `here <https://docs.omniverse.nvidia.com/kit/docs/omni_physics/107.3/dev_guide/guides/articulation_stability_guide.html#articulation-solver-order>`__.
.. versionadded:: v2.3
This parameter is only available with Isaac Sim 5.1.
"""
@configclass @configclass
class RenderCfg: class RenderCfg:
......
...@@ -30,7 +30,7 @@ from isaacsim.core.simulation_manager import SimulationManager ...@@ -30,7 +30,7 @@ from isaacsim.core.simulation_manager import SimulationManager
from isaacsim.core.utils.carb import get_carb_setting, set_carb_setting from isaacsim.core.utils.carb import get_carb_setting, set_carb_setting
from isaacsim.core.utils.viewports import set_camera_view from isaacsim.core.utils.viewports import set_camera_view
from isaacsim.core.version import get_version from isaacsim.core.version import get_version
from pxr import Gf, PhysxSchema, Usd, UsdPhysics from pxr import Gf, PhysxSchema, Sdf, Usd, UsdPhysics
from isaaclab.sim.utils import create_new_stage_in_memory, use_stage from isaaclab.sim.utils import create_new_stage_in_memory, use_stage
...@@ -786,6 +786,11 @@ class SimulationContext(_SimulationContext): ...@@ -786,6 +786,11 @@ class SimulationContext(_SimulationContext):
physx_scene_api.CreateGpuCollisionStackSizeAttr(self.cfg.physx.gpu_collision_stack_size) physx_scene_api.CreateGpuCollisionStackSizeAttr(self.cfg.physx.gpu_collision_stack_size)
# -- Improved determinism by PhysX # -- Improved determinism by PhysX
physx_scene_api.CreateEnableEnhancedDeterminismAttr(self.cfg.physx.enable_enhanced_determinism) physx_scene_api.CreateEnableEnhancedDeterminismAttr(self.cfg.physx.enable_enhanced_determinism)
# -- Set solve_articulation_contact_last by add attribute to the PhysxScene prim, and add attribute there.
physx_prim = physx_scene_api.GetPrim()
physx_prim.CreateAttribute("physxScene:solveArticulationContactLast", Sdf.ValueTypeNames.Bool).Set(
self.cfg.physx.solve_articulation_contact_last
)
# -- Gravity # -- Gravity
# note: Isaac sim only takes the "up-axis" as the gravity direction. But physics allows any direction so we # note: Isaac sim only takes the "up-axis" as the gravity direction. But physics allows any direction so we
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment