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
2 changes: 1 addition & 1 deletion source/isaaclab/config/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.46.2"
version = "0.46.3"

# Description
title = "Isaac Lab framework for Robot Learning"
Expand Down
9 changes: 9 additions & 0 deletions source/isaaclab/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
---------

0.46.3 (2025-09-18)
~~~~~~~~~~~~~~~~~~~

Changed
^^^^^^^

* Removed passing the ``activate_contact_sensors`` flag to the ``PhysxContactReportAPI`` when activating contact
sensors, which was incorrectly modifying the threshold attribute to 1 when contact sensors are activated.


0.46.2 (2025-09-13)
~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/sim/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def wrapper(prim_path: str | Sdf.Path, cfg: SpawnerCfg, *args, **kwargs):
sem.GetSemanticDataAttr().Set(semantic_value)
# activate rigid body contact sensors
if hasattr(cfg, "activate_contact_sensors") and cfg.activate_contact_sensors:
schemas.activate_contact_sensors(prim_paths[0], cfg.activate_contact_sensors)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm this definitely changes behaviors. Can we update the changelog and extension.toml for this? We'll need to report this as a breaking change I feel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya I agree it'll be a breaking change, but hopefully the new behavior makes it more intuitive. we can also keep this change out of the 2.3 release for now to be safe.

schemas.activate_contact_sensors(prim_paths[0])
# clone asset using cloner API
if len(prim_paths) > 1:
cloner = Cloner(stage=stage)
Expand Down
45 changes: 45 additions & 0 deletions source/isaaclab/test/sensors/test_contact_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import carb
import pytest
from flaky import flaky
from pxr import PhysxSchema

import isaaclab.sim as sim_utils
from isaaclab.assets import RigidObject, RigidObjectCfg
Expand Down Expand Up @@ -394,6 +395,50 @@ def test_sensor_print(setup_simulation):
print(scene.sensors["contact_sensor"])


@pytest.mark.parametrize("device", ["cuda:0", "cpu"])
def test_contact_sensor_threshold(setup_simulation, device):
"""Test that the contact sensor USD threshold attribute is set to 0.0."""
sim_dt, durations, terrains, devices, carb_settings_iface = setup_simulation
with build_simulation_context(device=device, dt=sim_dt, add_lighting=False) as sim:
sim._app_control_on_stop_handle = None
# Spawn things into stage
scene_cfg = ContactSensorSceneCfg(num_envs=1, env_spacing=1.0, lazy_sensor_update=False)
scene_cfg.terrain = FLAT_TERRAIN_CFG.replace(prim_path="/World/ground")
scene_cfg.shape = CUBE_CFG
scene_cfg.contact_sensor = ContactSensorCfg(
prim_path=scene_cfg.shape.prim_path,
track_pose=True,
debug_vis=False,
update_period=0.0,
track_air_time=True,
history_length=3,
)
scene = InteractiveScene(scene_cfg)
# Play the simulator
sim.reset()

# Get the stage and check the USD threshold attribute on the rigid body prim
from isaacsim.core.utils.stage import get_current_stage

stage = get_current_stage()
prim_path = scene_cfg.shape.prim_path
prim = stage.GetPrimAtPath(prim_path)

# Ensure the contact sensor was created properly
contact_sensor = scene["contact_sensor"]
assert contact_sensor is not None, "Contact sensor was not created"

# Check if the prim has contact report API and verify threshold is close to 0.0
if prim.HasAPI(PhysxSchema.PhysxContactReportAPI):
cr_api = PhysxSchema.PhysxContactReportAPI.Get(stage, prim.GetPrimPath())
threshold_attr = cr_api.GetThresholdAttr()
if threshold_attr.IsValid():
threshold_value = threshold_attr.Get()
assert (
pytest.approx(threshold_value, abs=1e-6) == 0.0
), f"Expected USD threshold to be close to 0.0, but got {threshold_value}"


"""
Internal helpers.
"""
Expand Down
Loading