Skip to content

[Bug Report] OVPhysX ray casters attribute rows to other environments when the scene clones several prototypes #8675

Closed

Description

@NeoZng

Describe the bug

On OVPhysX with CUDA, RayCaster, RayCasterCamera, MultiMeshRayCaster and MultiMeshRayCasterCamera report
other environments' data when the scene has more than one prototype, for example through MultiAssetSpawnerCfg.

OVPhysX discovers the bodies of each variant batch in clone order, so a tensor binding created from a pattern
lists its rows in that order, for example [env_0, env_2, env_1, env_3]. Since #7890, OvPhysxView and the
contact sensor re-bind such bindings from their prim paths in numeric environment order
(source/isaaclab_ov/isaaclab_ov/sim/views/ovphysx_view.py:694-702,
source/isaaclab_ov/isaaclab_ov/sensors/contact_sensor/contact_sensor.py:255-270), as the OVPhysX docs promise:
"Tensor bindings use numeric environment order so indexed resets, actions and observations address the correct
variant" (docs/source/concepts/physics-backends/ovphysx.rst:79-81). The ray casters, added before that in #5691,
still create both of their bindings from a bare pattern
(source/isaaclab_ov/isaaclab_ov/sensors/ray_caster/ray_caster.py):

  • the sensor frames, :101-104: row k of pos_w, quat_w and ray_hits_w belongs to another environment, and
    reset(env_ids) resets other environments' rows;
  • the tracked multi-mesh targets, :209: the env-major copy into the mesh table (:239-256) puts another
    environment's target pose into row k.

Homogeneous scenes are not affected, and nothing is reported: the rows are just attributed to the wrong
environments.

Steps to reproduce

Kitless OVPhysX on CUDA:

"""OVPhysX ray casters report other environments' rows when the scene clones several prototypes.

python repro_ovphysx_ray_caster_env_order.py --physics ovphysx --device cuda:0
"""

import argparse

from isaaclab.app import add_launcher_args, launch_simulation
from isaaclab.physics import PhysicsCfg

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


def main():
    with launch_simulation(PhysicsCfg(), args_cli) as physics_cfg:
        import isaaclab.sim as sim_utils
        from isaaclab.assets import RigidObjectCfg
        from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
        from isaaclab.sensors import MultiMeshRayCasterCfg, RayCasterCfg, patterns
        from isaaclab.terrains import TerrainImporterCfg
        from isaaclab.utils import configclass

        rigid_props = sim_utils.UsdPhysicsRigidBodyCfg(kinematic_enabled=True)
        collision_props = sim_utils.UsdPhysicsCollisionCfg()
        one_ray = patterns.GridPatternCfg(resolution=0.1, size=(0.0, 0.0))

        @configclass
        class SceneCfg(InteractiveSceneCfg):
            terrain = TerrainImporterCfg(prim_path="/World/ground", terrain_type="plane")
            crate = RigidObjectCfg(
                prim_path="{ENV_REGEX_NS}/Crate",
                spawn=sim_utils.CuboidCfg(
                    size=(0.2, 0.2, 0.2), rigid_props=rigid_props, collision_props=collision_props
                ),
                init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, -0.5, 0.1)),
            )
            # two variants, both 0.2 m high: the environments are cloned in two batches
            variant = RigidObjectCfg(
                prim_path="{ENV_REGEX_NS}/Variant",
                spawn=sim_utils.MultiAssetSpawnerCfg(
                    assets_cfg=[sim_utils.CuboidCfg(size=(0.2, 0.2, 0.2)), sim_utils.CuboidCfg(size=(0.3, 0.1, 0.2))],
                    rigid_props=rigid_props,
                    collision_props=collision_props,
                ),
                init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, 0.5, 0.1)),
            )
            # a ray caster on the crate, casting onto the ground
            ray_caster = RayCasterCfg(
                prim_path="{ENV_REGEX_NS}/Crate",
                mesh_prim_paths=["/World/ground"],
                pattern_cfg=one_ray,
                ray_alignment="world",
            )
            # a multi-mesh ray caster on the crate, casting onto the variant, a tracked target, 1 m below
            scanner = MultiMeshRayCasterCfg(
                prim_path="{ENV_REGEX_NS}/Crate",
                offset=MultiMeshRayCasterCfg.OffsetCfg(pos=(0.0, 1.0, 1.0)),
                mesh_prim_paths=[
                    "/World/ground",
                    MultiMeshRayCasterCfg.RaycastTargetCfg(prim_expr="{ENV_REGEX_NS}/Variant"),
                ],
                pattern_cfg=one_ray,
                ray_alignment="world",
            )

        sim = sim_utils.SimulationContext(sim_utils.SimulationCfg(device=args_cli.device, physics=physics_cfg))
        scene = InteractiveScene(SceneCfg(num_envs=4, env_spacing=2.0))
        sim.reset()

        def xyz(values):
            return [[round(v, 3) for v in row] for row in values.tolist()]

        print("crate position:         ", xyz(scene["crate"].data.root_pos_w.torch), flush=True)
        print("ray caster position:    ", xyz(scene["ray_caster"].data.pos_w.torch), flush=True)
        print("variant position:       ", xyz(scene["variant"].data.root_pos_w.torch), flush=True)
        print("scanner hit (expected 0.1 m above the variant position):", flush=True)
        print("                        ", xyz(scene["scanner"].data.ray_hits_w.torch[:, 0]), flush=True)


if __name__ == "__main__":
    main()

Expected: the ray-caster position matches the crate position of the same row, and each scanner hit lies 0.1 m above
the variant position of the same row.

Actual (develop):

crate position:          [[1.0, -1.5, 0.1], [1.0, 0.5, 0.1], [-1.0, -1.5, 0.1], [-1.0, 0.5, 0.1]]
ray caster position:     [[1.0, -1.5, 0.1], [-1.0, -1.5, 0.1], [1.0, 0.5, 0.1], [-1.0, 0.5, 0.1]]
variant position:        [[1.0, -0.5, 0.1], [1.0, 1.5, 0.1], [-1.0, -0.5, 0.1], [-1.0, 1.5, 0.1]]
scanner hit (expected 0.1 m above the variant position):
                         [[1.0, -0.5, 0.2], [-1.0, -0.5, 0.2], [1.0, 1.5, 0.2], [-1.0, 1.5, 0.2]]

Rows 1 and 2 of both ray casters belong to environments 2 and 1.

System Info

  • Commit: 9b6d2d822a (develop); release/3.0.0 (b63cbde282) has the same code and behaves the same
  • Isaac Sim Version: not used (kitless OVPhysX run, in an environment synced from develop's uv.lock); OVPhysX 0.6.4
  • OS: Ubuntu 24.04.2 LTS
  • GPU: NVIDIA RTX PRO 5000 72GB Blackwell
  • CUDA: 13.0
  • GPU Driver: 580.126.20

Additional context

  • The OVPhysX docs do not yet list the ray caster as supported (docs/source/concepts/physics-backends/ovphysx.rst:71-74),
    but the sensor factories dispatch all four ray casters to OVPhysX, and [OvPhysX] Add RayCaster sensor for the OVPhysX backend #5691 announced them.
  • Multi-body tracked targets (several patterns) raise NotImplementedError on OVPhysX (ray_caster.py:196-201), so
    only single-pattern targets reach the copy.

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

  • In a scene with several prototypes, each row of the OVPhysX ray casters, and each row of a multi-mesh ray
    caster's tracked targets, belongs to its own environment.

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