Skip to content

[Bug Report] Newton ContactSensors with identical body and filter expressions report zero forces except the last one #8648

Closed

Description

@NeoZng

Describe the bug

On the Newton backend, when several ContactSensors use the same body and filter expressions, only the last one
created reports contacts. The others report zero forces for the whole run. With track_air_time, they never detect
contact: their contact time stays zero and their air time keeps growing. A typical case is a reward sensor and an
observation sensor on the same feet that differ only in update_period, history_length or track_air_time; the
same happens when they differ in any other option, such as track_pose, and with filtered or multi-body sensors.
Nothing documents a limit of one sensor per body set, and Isaac Sim PhysX and OVPhysX report correctly.

NewtonManager.add_contact_sensor keys the Newton SensorContact by the four expressions
(isaaclab_newton/physics/newton_manager.py:2063). It still constructs a new one on every call and overwrites
the entry (:2076, :2086). _update_sensors updates only the registered sensors (:1737). Each Isaac Lab
sensor, however, keeps the output arrays of the Newton sensor that was registered when it initialized
(isaaclab_newton/sensors/contact_sensor/contact_sensor.py:392-434). The earlier sensors therefore read a replaced
Newton sensor that is never updated again.

Steps to reproduce

A 1 kg cube rests on the ground and is watched by two sensors that differ only in their update settings. Save the
script as repro.py and run uv run python repro.py (Newton), uv run python repro.py --physics ovphysx or
uv run python repro.py --physics isaacsim_physx.

import argparse

from isaaclab.app import add_launcher_args, launch_simulation

parser = argparse.ArgumentParser()
parser.add_argument("--physics", default="newton_mjwarp")
add_launcher_args(parser)
args_cli = parser.parse_args()

import isaaclab.sim as sim_utils
from isaaclab.assets import RigidObjectCfg
from isaaclab.physics import PhysicsCfg
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.sensors import ContactSensorCfg
from isaaclab.terrains import TerrainImporterCfg
from isaaclab.utils import configclass

DT = 0.005


@configclass
class SceneCfg(InteractiveSceneCfg):
    terrain = TerrainImporterCfg(prim_path="/World/ground", terrain_type="plane")
    cube = RigidObjectCfg(
        prim_path="{ENV_REGEX_NS}/Cube",
        spawn=sim_utils.CuboidCfg(
            size=(0.2, 0.2, 0.2),
            rigid_props=sim_utils.UsdPhysicsRigidBodyCfg(),
            mass_props=sim_utils.MassCfg(mass=1.0),
            collision_props=sim_utils.UsdPhysicsCollisionCfg(),
            activate_contact_sensors=True,
        ),
        init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, 0.0, 0.1)),
    )
    # same body and filter, different update settings
    contact_a = ContactSensorCfg(prim_path="{ENV_REGEX_NS}/Cube", history_length=3)
    contact_b = ContactSensorCfg(prim_path="{ENV_REGEX_NS}/Cube", update_period=0.02)


with launch_simulation(PhysicsCfg(), args_cli) as physics_cfg:
    from isaaclab.scene import InteractiveScene
    from isaaclab.sim import SimulationContext

    sim = SimulationContext(sim_utils.SimulationCfg(dt=DT, device=args_cli.device, physics=physics_cfg))
    scene = InteractiveScene(SceneCfg(num_envs=1, env_spacing=2.0))
    sim.reset()
    scene.reset()
    for _ in range(100):
        scene.write_data_to_sim()
        sim.step(render=False)
        scene.update(DT)
    for name in ("contact_a", "contact_b"):
        print(f"{name}: normal force z {scene[name].data.net_normal_forces_w.torch[0, 0, 2].item():.3f} N")

Actual, Newton (--physics newton_mjwarp, the default):

contact_a: normal force z 0.000 N
contact_b: normal force z 9.810 N

Expected, and what OVPhysX and Isaac Sim PhysX print:

contact_a: normal force z 9.810 N
contact_b: normal force z 9.810 N

System Info

  • Commit: 06f2d42 (develop); release/3.0.0 (6bfde87) has the same code and behavior. The code is unchanged on
    develop d7339b7 (Newton 71eeba16, MuJoCo Warp 3.15.0), where the regression test of the fix fails the same way.
    The repro prints the same output on develop 9b6d2d8 in an environment synced from its uv.lock (Newton 1.8.0.dev0,
    MuJoCo Warp 3.15.0).
  • Isaac Sim Version: 6.1.0-rc.26 (Isaac Sim PhysX run); Newton 5ea82eef (develop pin), MuJoCo Warp 3.14.0
  • OS: Ubuntu 24.04
  • GPU: NVIDIA RTX PRO 5000 Blackwell
  • CUDA: 13.0
  • GPU Driver: 580.126.20

Additional context

Open draft #8218 (Newton manager rewrite) also lets identical requests share one Newton sensor.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

  • Every Newton ContactSensor reports contacts when other sensors use the same body and filter expressions,
    also after a hard sim.reset().

Activity

  1. RandomOakForest commented on Oct 16, 2026

    @RandomOakForest
    Collaborator

    Thank you for posting this and adding the PR. The team will review it.

  2. added
    bug
    on Oct 16, 2026
  3. NeoZng commented on Oct 27, 2026

    @NeoZng
    ContributorAuthor

    Fixed on main by #8733: the regression test from #8649 passes there, so I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions