Skip to content

[Bug Report] Multi-mesh ray casters on kitless backends give every environment environment 0's static targets #8680

Closed

Description

@NeoZng

Describe the bug

Without Kit (Newton, OVPhysX), a MultiMeshRayCaster or MultiMeshRayCasterCamera target inside the environments
that is not tracked, such as RaycastTargetCfg(prim_expr="{ENV_REGEX_NS}/Crate", track_mesh_transforms=False) or a
plain string entry of mesh_prim_paths (converted to an untracked target, base_multi_mesh_ray_caster.py:112-114),
exists only in environment 0. Every environment's mesh table holds environment 0's copy at environment 0's pose, so
the rays of all other environments miss their own copy.

  • _build_mesh_records takes the clone plan only for tracked targets
    (isaaclab/sensors/ray_caster/base_multi_mesh_ray_caster.py:209-210, although the comment there says the plan is
    preferred for environment-scoped targets because the destination prims may not exist). An untracked target is
    looked up on the USD stage instead (:294-314).
  • Without Kit, the assets are cloned only into the physics backend; USD clones are authored only when Kit runs
    (isaaclab/cloner/replicate_session.py:96-97). The stage holds only the source environment's prims, and the single
    match is given to every environment (base_multi_mesh_ray_caster.py:316-317).
  • With several prototypes, the stage holds one source per prototype. A MultiAssetSpawnerCfg target with two variants
    in four environments then fails the even-partition check (:319-323) on OVPhysX:
    RuntimeError: Target expression '/World/envs/env_[^/]+/Target' matched 2 mesh records, which cannot be evenly partitioned across 4 environments.
    A target that only one of two clone combinations includes gets environment 0's copy in all four environments. With
    Kit, that scene raises the same partition error, because the stage holds the target only in the two environments
    that have it.

Tracked targets of the same scene are correct, because they resolve through the clone plan. With Kit (Isaac Sim
PhysX), the clones exist on the stage, so each environment gets its own copy. The target docs do not restrict
untracked targets to prims outside the environments (multi_mesh_ray_caster_cfg.py:47-52).

Not measured: the Kuka-Allegro lift raycaster_depth* camera presets list the untracked target
{ENV_REGEX_NS}/table (isaaclab_tasks/core/lift/config/kuka_allegro/camera_cfg.py:63-67), and the lift task has
ovphysx and newton_mjwarp physics presets (lift_env_cfg.py:503-525).

Steps to reproduce

Four environments, each with a kinematic crate whose top face is at z = 0.2 m. Two ray casters on the crate cast one
ray straight down from 1 m above its center onto the crate, once as an untracked and once as a tracked target. Save
the script as repro.py and run uv run python repro.py --physics newton_mjwarp, --physics ovphysx and
--physics isaacsim_physx.

import argparse

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

parser = argparse.ArgumentParser()
parser.add_argument("--physics", default="newton_mjwarp")
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, patterns
        from isaaclab.utils import configclass

        def scanner(track_mesh_transforms):
            # one ray straight down onto the crate, from 1 m above its center
            return MultiMeshRayCasterCfg(
                prim_path="{ENV_REGEX_NS}/Crate",
                offset=MultiMeshRayCasterCfg.OffsetCfg(pos=(0.0, 0.0, 1.0)),
                mesh_prim_paths=[
                    MultiMeshRayCasterCfg.RaycastTargetCfg(
                        prim_expr="{ENV_REGEX_NS}/Crate", track_mesh_transforms=track_mesh_transforms
                    )
                ],
                pattern_cfg=patterns.GridPatternCfg(resolution=0.1, size=(0.0, 0.0)),
                ray_alignment="world",
            )

        @configclass
        class SceneCfg(InteractiveSceneCfg):
            # a 0.2 m crate that does not move: its top face is at z = 0.2 m
            crate = RigidObjectCfg(
                prim_path="{ENV_REGEX_NS}/Crate",
                spawn=sim_utils.CuboidCfg(
                    size=(0.2, 0.2, 0.2),
                    rigid_props=sim_utils.UsdPhysicsRigidBodyCfg(kinematic_enabled=True),
                    collision_props=sim_utils.UsdPhysicsCollisionCfg(),
                ),
                init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, 0.0, 0.1)),
            )
            static_scanner = scanner(track_mesh_transforms=False)
            tracked_scanner = scanner(track_mesh_transforms=True)

        sim_cfg = sim_utils.SimulationCfg(device=args_cli.device, gravity=(0.0, 0.0, 0.0), physics=physics_cfg)
        sim = sim_utils.SimulationContext(sim_cfg)
        scene = InteractiveScene(SceneCfg(num_envs=4, env_spacing=2.0))
        sim.reset()
        sim.step()
        scene.update(sim.get_physics_dt())

        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("static target hits:  ", xyz(scene["static_scanner"].data.ray_hits_w.torch[:, 0]), flush=True)
        print("tracked target hits: ", xyz(scene["tracked_scanner"].data.ray_hits_w.torch[:, 0]), flush=True)


if __name__ == "__main__":
    main()

Actual, --physics newton_mjwarp and --physics ovphysx (the same output):

crate position:       [[1.0, -1.0, 0.1], [1.0, 1.0, 0.1], [-1.0, -1.0, 0.1], [-1.0, 1.0, 0.1]]
static target hits:   [[1.0, -1.0, 0.2], [inf, inf, inf], [inf, inf, inf], [inf, inf, inf]]
tracked target hits:  [[1.0, -1.0, 0.2], [1.0, 1.0, 0.2], [-1.0, -1.0, 0.2], [-1.0, 1.0, 0.2]]

Expected: the static target hits equal the tracked ones, as with --physics isaacsim_physx (Kit):

crate position:       [[1.0, -1.0, 0.1], [1.0, 1.0, 0.1], [-1.0, -1.0, 0.1], [-1.0, 1.0, 0.1]]
static target hits:   [[1.0, -1.0, 0.2], [1.0, 1.0, 0.2], [-1.0, -1.0, 0.2], [-1.0, 1.0, 0.2]]
tracked target hits:  [[1.0, -1.0, 0.2], [1.0, 1.0, 0.2], [-1.0, -1.0, 0.2], [-1.0, 1.0, 0.2]]

System Info

  • Commit: develop 9b6d2d8. release/3.0.0 (b63cbde) has the same base_multi_mesh_ray_caster.py; a regression
    test with an untracked target in four environments fails there too, on Newton (1.6.1, MuJoCo Warp 3.12.0) and on
    OVPhysX.
  • Isaac Sim Version: not used (kitless Newton and OVPhysX runs, in environments synced from develop's uv.lock);
    Newton 1.8.0.dev0 (71eeba16), MuJoCo Warp 3.15.0, OVPhysX 0.6.4, Warp 1.17.0. The isaacsim_physx comparison ran
    with Isaac Sim 6.2.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

  • Without Kit, each environment's rays hit its own copy of an untracked target inside the environments.
  • With several prototypes, each environment holds its own prototype's copy of the target, or none.
  • With Kit, the mesh tables stay as they are where the stage holds every copy.

Activity

  1. RandomOakForest commented on Oct 16, 2026

    @RandomOakForest
    Collaborator

    Thank you for posting this and the other bug reports. The PRs are appreciated. I will tag this and the other reports you posted today for the team to review. I will write we have received this reports in each of them and triage to the team for review. If you think we missed something, don't hesitate to write a comment as needed. Thank you for your interest in Isaac Lab.

  2. added
    bug
    on Oct 16, 2026
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