Skip to content
Open
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
11 changes: 11 additions & 0 deletions source/isaaclab/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Changelog
---------

0.48.1 (2025-11-10)
~~~~~~~~~~~~~~~~~~~

Added
^^^^^

* Added :attr:`~isaaclab.sim.PhysxCfg.enable_external_forces_every_iteration` to enable external forces every position iteration.
This can help improve the accuracy of velocity updates. Consider enabling this flag if the velocities generated by the simulation are noisy.
* Added warning when :attr:`~isaaclab.sim.PhysxCfg.enable_external_forces_every_iteration` is set to False and the solver type is TGS.


0.48.0 (2025-11-03)
~~~~~~~~~~~~~~~~~~~

Expand Down
13 changes: 13 additions & 0 deletions source/isaaclab/isaaclab/sim/simulation_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ class PhysxCfg:
Enabling this flag may lead to incorrect contact forces report from the contact sensor.
"""

enable_external_forces_every_iteration: bool = False
"""Enable/disable external forces every position iteration in the TGS solver. Default is False.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @Mayankm96's preference was to keep this to True so that by default we always get the most accurate data. If users need better perf, they can set it to False.

I don't feel too strongly either way. My concern was mostly that setting it to True by default might break existing policies if they use joint velocities, but data accuracy is also important.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my concern too. It may change the default behavior of the sim, and that may be considered a breaking change? I'd say for this version we keep it this way, and for 3.0 we can make it a default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok yup that was my thought as well. let's keep it False for now until 3.0.


When using the TGS solver (:attr:`solver_type` is 1), this flag allows enabling external forces every solver position iteration.
This can help improve the accuracy of velocity updates. Consider enabling this flag if the velocities generated by
the simulation are noisy. Increasing the number of velocity iterations, together with this flag, can help improve
the accuracy of velocity updates.

.. note::

This flag is ignored when using the PGS solver (:attr:`solver_type` is 0).
"""

enable_enhanced_determinism: bool = False
"""Enable/disable improved determinism at the expense of performance. Defaults to False.

Expand Down
13 changes: 13 additions & 0 deletions source/isaaclab/isaaclab/sim/simulation_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,19 @@ def _set_additional_physx_params(self):
physx_prim.CreateAttribute("physxScene:solveArticulationContactLast", Sdf.ValueTypeNames.Bool).Set(
self.cfg.physx.solve_articulation_contact_last
)
# -- Enable external forces every iteration, helps improve the accuracy of velocity updates.

if self.cfg.physx.solver_type == 1:
if not self.cfg.physx.enable_external_forces_every_iteration:
omni.log.warn(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we move away from omni.log?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I wait for Pascal's PR to be in?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has landed :)

"The `enable_external_forces_every_iteration` parameter in the PhysxCfg is set to False. If you are"
" experiencing noisy velocities, consider enabling this flag. You may need to slightly increase the"
" number of velocity iterations (setting it to 1 or 2 rather than 0), together with this flag, to"
" improve the accuracy of velocity updates."
)
Comment on lines +799 to +804
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: The backtick wrapping of enable_external_forces_every_iteration in the warning message is inconsistent with Python string formatting and will display the backticks literally to users

physx_scene_api.CreateEnableExternalForcesEveryIterationAttr(
self.cfg.physx.enable_external_forces_every_iteration
)

# -- Gravity
# note: Isaac sim only takes the "up-axis" as the gravity direction. But physics allows any direction so we
Expand Down