Skip to content

Sets enable_stabilization to false by default. #2628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 12, 2025
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
13 changes: 11 additions & 2 deletions source/isaaclab/isaaclab/sim/simulation_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,17 @@ 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::

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.
"""

enable_enhanced_determinism: bool = False
"""Enable/disable improved determinism at the expense of performance. Defaults to False.
Expand Down
8 changes: 8 additions & 0 deletions source/isaaclab/isaaclab/sim/simulation_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions source/isaaclab/test/assets/test_rigid_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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:])
Expand Down