Skip to content

[Bug Report] Newton hard resets inject IMU, PVA and frame transformer sites again: several environments fail, a ray caster can move to another body #8673

Closed

Description

@NeoZng

Describe the bug

On Newton, sim.reset() on a running simulation is a hard reset. NewtonManager.reset(soft=False) dispatches
STOP, keeps the builder and its site map, and finalizes a new model from the builder
(isaaclab_newton/physics/newton_manager.py:611-635).

On STOP, the Newton Imu, Pva and FrameTransformer register their sites again
(sensors/imu/imu.py:189-191, sensors/pva/pva.py:262-264, sensors/frame_transformer/frame_transformer.py:353-363).
The pending sites were cleared after the first injection (newton_manager.py:1069), so the new registrations get
fresh labels counted from ft_0 (:977). start_simulation then injects them into the kept builder, which is
already replicated, and stores a single-world entry for each label in the site map (:1226-1234).

  • Two or more environments: the second sim.reset() fails. If an asset wraps the body, its view rejects the
    shape layout (assets/rigid_object/rigid_object.py:1072):
    ValueError: Articulation SHAPE layout is unavailable: selected values or their owners differ between articulations (first at world 1, articulation 0).
    Without an asset, the frame transformer's own check fails (frame_transformer.py:213):
    FrameTransformer source '/World/envs/env_[^/]+/Box' has 1 world entries in the site map, expected 2.
  • One environment: nothing fails, but sensors that register their site only in __init__, such as the Newton
    ray caster (sensors/ray_caster/newton_raycast_sensor.py:99), keep their label while it is reassigned to another
    sensor's new site. A height scanner declared before an IMU then reports the IMU body's pose, with no error.
  • Frame transformer target names: initialization replaces the configured target names with one name per matched
    body (frame_transformer.py:156-158), and the next initialization looks the configured names up in that list by
    target index (:148, :294). With targets Cube.* (matching CubeA and CubeB), then CubeA named cube_a,
    data.target_frame_names is ['CubeA', 'CubeB', 'cube_a'] after the first sim.reset() and
    ['CubeA', 'CubeB', 'CubeB'] after every hard reset, and find_bodies("cube_a") raises
    ValueError: Not all regular expressions are matched!. The poses stay correct. This already happens with one
    environment; with several, the reset above fails first.
  • Every hard reset: one more native IMU and frame transform sensor is appended (newton_manager.py:2153-2154,
    :2178-2179), and the old ones are never dropped (the hard reset at :611-635 does not clear them). Stale IMU entries
    are still updated on every step (:1752-1753). Readings stay correct; this is a leak and a per-step cost.

A hard reset is a supported operation: the reset docstring describes it, the Newton ray-caster tests cover it with
one environment, and scripts such as scripts/tools/record_demos.py and scripts/tools/replay_demos.py call
env.sim.reset() on a live environment.

Steps to reproduce

Two cubes; a height scanner on CubeA is declared before an IMU on CubeB. Save the script as repro.py and run
uv run python repro.py (one environment) and uv run python repro.py --num_envs 2.

import argparse

from isaaclab.app import add_launcher_args, launch_simulation

parser = argparse.ArgumentParser()
parser.add_argument("--physics", default="newton_mjwarp")
parser.add_argument("--num_envs", type=int, default=1)
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 ImuCfg, RayCasterCfg, patterns
from isaaclab.terrains import TerrainImporterCfg
from isaaclab.utils import configclass

DT = 0.005


def cube_cfg(name, x):
    return RigidObjectCfg(
        prim_path="{ENV_REGEX_NS}/" + name,
        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(),
        ),
        init_state=RigidObjectCfg.InitialStateCfg(pos=(x, 0.0, 0.1)),
    )


@configclass
class SceneCfg(InteractiveSceneCfg):
    terrain = TerrainImporterCfg(prim_path="/World/ground", terrain_type="plane")
    cube_a = cube_cfg("CubeA", -0.5)
    cube_b = cube_cfg("CubeB", 0.5)
    # a height scanner on CubeA, declared before an IMU on CubeB
    scanner = RayCasterCfg(
        prim_path="{ENV_REGEX_NS}/CubeA",
        mesh_prim_paths=["/World/ground"],
        pattern_cfg=patterns.GridPatternCfg(resolution=0.1, size=(0.2, 0.2)),
    )
    imu = ImuCfg(prim_path="{ENV_REGEX_NS}/CubeB")


with launch_simulation(PhysicsCfg(), args_cli) as physics_cfg:
    from isaaclab_newton.physics import NewtonManager

    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=args_cli.num_envs, env_spacing=2.0))
    for count in range(1, 4):
        sim.reset()  # every call after the first is a hard reset
        scene.reset()
        for _ in range(5):
            sim.step(render=False)
            scene.update(DT)
        scanner_x = scene["scanner"].data.pos_w.torch[0, 0].item()
        cube_a_x = scene["cube_a"].data.root_link_pos_w.torch[0, 0].item()
        cube_b_x = scene["cube_b"].data.root_link_pos_w.torch[0, 0].item()
        print(
            f"sim.reset() #{count}: scanner x {scanner_x:+.3f} m, CubeA x {cube_a_x:+.3f} m, CubeB x {cube_b_x:+.3f} m,"
            f" native IMU sensors: {len(NewtonManager._newton_imu_sensors)}"
        )

Actual, one environment (the scanner follows CubeB after the first hard reset):

sim.reset() #1: scanner x -0.500 m, CubeA x -0.500 m, CubeB x +0.500 m, native IMU sensors: 1
sim.reset() #2: scanner x +0.500 m, CubeA x -0.500 m, CubeB x +0.500 m, native IMU sensors: 2
sim.reset() #3: scanner x +0.500 m, CubeA x -0.500 m, CubeB x +0.500 m, native IMU sensors: 3

Actual, --num_envs 2:

sim.reset() #1: scanner x +0.500 m, CubeA x +0.500 m, CubeB x +1.500 m, native IMU sensors: 1
Traceback (most recent call last):
  File "repro.py", line 58, in <module>
    sim.reset()  # every call after the first is a hard reset
  ...
  File ".../isaaclab_newton/assets/rigid_object/rigid_object.py", line 1072, in _initialize_impl
    self._root_view = ArticulationView(
  File ".../newton/_src/utils/selection.py", line 1083, in __init__
    raise ValueError(f"Articulation {frequency.name} layout is unavailable: {reason}")
ValueError: Articulation SHAPE layout is unavailable: selected values or their owners differ between articulations (first at world 1, articulation 0)

Expected: every reset prints the first line again (the scanner stays on CubeA, one native IMU sensor), with one and
with two environments. With two environments, a FrameTransformerCfg instead of the IMU fails the same way; the
Pva has the same STOP callback.

System Info

  • Commit: develop 9b6d2d8. release/3.0.0 (b63cbde, Newton 1.6.1, MuJoCo Warp 3.12.0) has the same code. A
    regression test with these sensors fails there too: with one environment the ray caster is 1.0 m off, and with
    two the second sim.reset() raises an IndexError in the ray caster's site lookup
    (newton_raycast_sensor.py:228) instead.
  • Isaac Sim Version: not used (kitless Newton run, in an environment synced from develop's uv.lock); Newton
    1.8.0.dev0 (71eeba16), MuJoCo Warp 3.15.0, Warp 1.17.0
  • OS: Ubuntu 24.04
  • GPU: NVIDIA RTX PRO 5000 72GB Blackwell
  • CUDA: 13.0
  • GPU Driver: 580.126.20

Additional context

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

  • Repeated sim.reset() calls on Newton succeed with several environments when an IMU, PVA or frame transformer
    is present, and every sensor keeps reporting its own body.
  • Hard resets do not accumulate native IMU or frame transform sensors.
  • The frame transformer keeps its target names across hard resets.

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. added a commit that references this issue on Oct 22, 2026
    8c9b995
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