From b28089dbb9582eac7d07426aa66c6f58bf24cb6a Mon Sep 17 00:00:00 2001 From: Antoine Richard Date: Thu, 5 Jun 2025 11:40:50 +0200 Subject: [PATCH 1/6] Setting enable_stabilization to false by default. --- source/isaaclab/isaaclab/sim/simulation_cfg.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/isaaclab/isaaclab/sim/simulation_cfg.py b/source/isaaclab/isaaclab/sim/simulation_cfg.py index e56389b3262..29f5af3b7cf 100644 --- a/source/isaaclab/isaaclab/sim/simulation_cfg.py +++ b/source/isaaclab/isaaclab/sim/simulation_cfg.py @@ -87,8 +87,14 @@ class PhysxCfg: """Enable a second broad-phase pass that makes it possible to prevent objects from tunneling through each other. Default is False.""" - enable_stabilization: bool = True - """Enable/disable additional stabilization pass in solver. Default is True.""" + enable_stabilization: bool = False + """Enable/disable additional stabilization pass in solver. Default is False. + + .. note:: + + Setting this flag to True should only be done if the simulation steps are very large (less than 30Hz). + Enabling this flag can lead to incorrect forces being read from the contact sensor. + """ enable_enhanced_determinism: bool = False """Enable/disable improved determinism at the expense of performance. Defaults to False. From 362bdff4c7027c15a7c827dbf81e4bff03ecfb41 Mon Sep 17 00:00:00 2001 From: Antoine Richard Date: Thu, 10 Jul 2025 16:07:12 +0200 Subject: [PATCH 2/6] Fixed failing rigid object tests by increasing the tolerances. --- source/isaaclab/test/assets/test_rigid_object.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/isaaclab/test/assets/test_rigid_object.py b/source/isaaclab/test/assets/test_rigid_object.py index 6dc7b0b7d77..5c2be6508ff 100644 --- a/source/isaaclab/test/assets/test_rigid_object.py +++ b/source/isaaclab/test/assets/test_rigid_object.py @@ -591,7 +591,7 @@ def test_rigid_body_with_static_friction(num_cubes, device): cube_object.update(sim.cfg.dt) if force == "below_mu": # Assert that the block has not moved - torch.testing.assert_close(cube_object.data.root_pos_w, initial_root_pos, rtol=1e-3, atol=1e-3) + torch.testing.assert_close(cube_object.data.root_pos_w, initial_root_pos, rtol=2e-3, atol=2e-3) if force == "above_mu": assert (cube_object.data.root_state_w[..., 0] - initial_root_pos[..., 0] > 0.02).all() @@ -848,8 +848,8 @@ def test_body_root_state_properties(num_cubes, device, with_offset): lin_vel_rel_root_gt = quat_apply_inverse(root_link_state_w[..., 3:7], root_link_state_w[..., 7:10]) lin_vel_rel_body_gt = quat_apply_inverse(body_link_state_w[..., 3:7], body_link_state_w[..., 7:10]) lin_vel_rel_gt = torch.linalg.cross(spin_twist.repeat(num_cubes, 1)[..., 3:], -offset) - torch.testing.assert_close(lin_vel_rel_gt, lin_vel_rel_root_gt, atol=1e-4, rtol=1e-4) - torch.testing.assert_close(lin_vel_rel_gt, lin_vel_rel_body_gt.squeeze(-2), atol=1e-4, rtol=1e-4) + torch.testing.assert_close(lin_vel_rel_gt, lin_vel_rel_root_gt, atol=1e-3, rtol=1e-3) + torch.testing.assert_close(lin_vel_rel_gt, lin_vel_rel_body_gt.squeeze(-2), atol=1e-3, rtol=1e-3) # ang_vel will always match torch.testing.assert_close(root_state_w[..., 10:], root_com_state_w[..., 10:]) From 1fe60f785152efbae7c1ba7f99c9608b793ee41c Mon Sep 17 00:00:00 2001 From: Antoine RICHARD Date: Thu, 10 Jul 2025 16:07:51 +0200 Subject: [PATCH 3/6] Update source/isaaclab/isaaclab/sim/simulation_cfg.py Co-authored-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com> Signed-off-by: Antoine RICHARD --- source/isaaclab/isaaclab/sim/simulation_cfg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/isaaclab/isaaclab/sim/simulation_cfg.py b/source/isaaclab/isaaclab/sim/simulation_cfg.py index 29f5af3b7cf..2ea3986ac60 100644 --- a/source/isaaclab/isaaclab/sim/simulation_cfg.py +++ b/source/isaaclab/isaaclab/sim/simulation_cfg.py @@ -93,7 +93,10 @@ class PhysxCfg: .. note:: Setting this flag to True should only be done if the simulation steps are very large (less than 30Hz). - Enabling this flag can lead to incorrect forces being read from the contact sensor. + + .. warn:: + + Enabling this flag may lead to incorrect contact forces report from the contact sensor. """ enable_enhanced_determinism: bool = False From 019afabca391ab06429fe563ac88a1365837d806 Mon Sep 17 00:00:00 2001 From: Antoine RICHARD Date: Thu, 10 Jul 2025 16:08:04 +0200 Subject: [PATCH 4/6] Update source/isaaclab/isaaclab/sim/simulation_cfg.py Co-authored-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com> Signed-off-by: Antoine RICHARD --- source/isaaclab/isaaclab/sim/simulation_cfg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/isaaclab/isaaclab/sim/simulation_cfg.py b/source/isaaclab/isaaclab/sim/simulation_cfg.py index 2ea3986ac60..79c23937990 100644 --- a/source/isaaclab/isaaclab/sim/simulation_cfg.py +++ b/source/isaaclab/isaaclab/sim/simulation_cfg.py @@ -92,7 +92,7 @@ class PhysxCfg: .. note:: - Setting this flag to True should only be done if the simulation steps are very large (less than 30Hz). + We recommend setting this flag to true only when the simulation step size is large (i.e., less than 30 Hz or more than 0.0333 seconds). .. warn:: From 82cb483e615d61ddb71510a88d7e0c4f3b17a665 Mon Sep 17 00:00:00 2001 From: Antoine Richard Date: Thu, 10 Jul 2025 16:10:14 +0200 Subject: [PATCH 5/6] pre-commits --- source/isaaclab/isaaclab/sim/simulation_cfg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/isaaclab/isaaclab/sim/simulation_cfg.py b/source/isaaclab/isaaclab/sim/simulation_cfg.py index 79c23937990..cbfed1ed0a9 100644 --- a/source/isaaclab/isaaclab/sim/simulation_cfg.py +++ b/source/isaaclab/isaaclab/sim/simulation_cfg.py @@ -95,7 +95,7 @@ class PhysxCfg: We recommend setting this flag to true only when the simulation step size is large (i.e., less than 30 Hz or more than 0.0333 seconds). .. warn:: - + Enabling this flag may lead to incorrect contact forces report from the contact sensor. """ From 3e8adf4566f1f8ae34ab2f5dee768294f400f8fb Mon Sep 17 00:00:00 2001 From: Antoine Richard Date: Thu, 10 Jul 2025 16:24:39 +0200 Subject: [PATCH 6/6] added a warning if the stabilization is disabled and the dt is too large --- source/isaaclab/isaaclab/sim/simulation_context.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py index 82e72074147..45956ae936b 100644 --- a/source/isaaclab/isaaclab/sim/simulation_context.py +++ b/source/isaaclab/isaaclab/sim/simulation_context.py @@ -234,6 +234,14 @@ def __init__(self, cfg: SimulationCfg | None = None): physx_params = sim_params.pop("physx") sim_params.update(physx_params) # create a simulation context to control the simulator + + if not self.cfg.physx.enable_stabilization and (self.cfg.dt > 0.0333): + omni.log.warn( + "Large simulation step size (> 0.0333 seconds) is not recommended without enabling stabilization." + " Consider setting the `enable_stabilization` flag to True in the PhysxCfg, or reducing the" + " simulation step size if you run into physics issues." + ) + super().__init__( stage_units_in_meters=1.0, physics_dt=self.cfg.dt,