Skip to content

[OvPhysX] Add RayCaster sensor for the OVPhysX backend - #5691

Merged
AntoineRichard merged 8 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/feat/ovphysx_raycaster
Jun 17, 2026
Merged

AntoineRichard merged 8 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/feat/ovphysx_raycaster

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented May 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds isaaclab_ovphysx.sensors.ray_caster so RayCaster(cfg),
RayCasterCamera, MultiMeshRayCaster, and MultiMeshRayCasterCamera
dispatch correctly under an OVPhysX SimulationContext. Unblocks
Isaac-Velocity-Rough-Anymal-D-v0 under presets=ovphysx (the
height_scanner is a RayCaster).

Mirrors isaaclab_physx.sensors.ray_caster structure: a single
_OvPhysxRayCasterMixin (~200 lines in ray_caster.py) carries the
backend-specific pose-tracking surface, reading live body poses via the
ovphysx wheel's
create_tensor_binding(pattern=..., tensor_type=RIGID_BODY_POSE) API.
Three 14-line sibling modules compose the mixin with the matching
Base* class. Static (non-physics) sensor frames fall back to a
one-time USD pose snapshot, matching PhysX's
_initialize_static_pose_tracking.

Multi-mesh dynamic targets create a second binding via the same
create_tensor_binding call. v1 limitation: target paths must dedup
to a single env-wildcard pattern; multi-pattern targets raise
NotImplementedError (mirrors the OVPhysX ContactSensor
track_pose single-body constraint).

Also wires isaaclab_ovphysx.sensors.ContactSensorCfg and
isaaclab_ovphysx.physics.OvPhysxCfg into the shared
LocomotionVelocityRoughEnvCfg.RoughPhysicsCfg so
Isaac-Velocity-Rough-Anymal-D-v0 can pick the right preset under
presets=ovphysx.

Built on top of #5678 (FrameView, now merged). Anymal-D Rough at
4096 envs needs FrameView's clone_usd=True + env_0 USD stripping to
avoid a wheel-side hang during init; with #5678 in develop, this PR is
now a standalone three-commit diff:

  • Wire OvPhysX preset into shared RoughPhysicsCfg
  • Route RayCaster dispatch to ovphysx backend
  • Add isaaclab_ovphysx.sensors.ray_caster package

Verified locally:

  • ./isaaclab.sh -p scripts/environments/random_agent.py --task Isaac-Velocity-Rough-Anymal-D-v0 --num_envs 64 --headless presets=ovphysx reaches the agent loop cleanly.
  • ./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/train.py --task Isaac-Velocity-Rough-Anymal-D-v0 --num_envs 4096 --max_iterations 100 --headless presets=ovphysx completes 100 iterations with non-degenerate mean reward.

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)

Screenshots

N/A — backend dispatch + sensor implementation, no UI surface.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label May 19, 2026

@isaaclab-review-bot isaaclab-review-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: OVPhysX RayCaster Sensor Implementation

This PR adds the OVPhysX backend for RayCaster, RayCasterCamera, MultiMeshRayCaster, and MultiMeshRayCasterCamera sensors. The implementation follows the established pattern from the PhysX and Newton backends while addressing OVPhysX-specific constraints around USD cloning and tensor bindings.

✅ Strengths

  1. Clean Mixin Architecture: The _OvPhysxRayCasterMixin centralizes all backend-specific logic, allowing the four sensor classes to be simple composition modules. This mirrors the structure in isaaclab_physx.

  2. Proper Clone-Plan Integration: The latest commit (f4b6d4f) correctly delegates to SensorBase._resolve_rigid_body_ancestor_expr() for pose binding resolution, which handles clone-plan sources even when destination USD prims do not exist.

  3. Static Frame Fallback: Non-physics sensor frames (no rigid-body ancestor) correctly fall back to a one-time USD pose snapshot via _initialize_static_pose_tracking.

  4. Resource Cleanup: _invalidate_initialize_callback properly destroys tensor bindings and clears mesh view buffers when the simulation stops.

  5. Well-Documented Limitations: The v1 single-pattern constraint for multi-mesh targets is clearly documented with NotImplementedError and matches the ContactSensor limitation.

⚠️ Suggestions (Non-Blocking)

1. Test Coverage for Multi-Mesh Dynamic Targets (Low)

The new test_ray_caster.py covers the clone-plan resolution path, but _create_tracked_target_view and _update_mesh_transforms for MultiMeshRayCaster with track_mesh_transforms=True remain untested. Consider adding coverage in a follow-up.

2. Floor-Division Safety in _update_mesh_transforms (Low)

In ray_caster.py (around line 240), meshes_per_env = view_count // self._num_envs assumes exact divisibility. An assertion like assert view_count % self._num_envs == 0 would catch misconfigured scene graphs early.

📋 Summary

Commits reviewed (4 total):

  • 781b587b - Wire OvPhysX preset into shared RoughPhysicsCfg
  • e098c274 - Route RayCaster dispatch to ovphysx backend
  • 0fbd27b1 - Add isaaclab_ovphysx.sensors.ray_caster package
  • f4b6d4f0 - Fix OVPhysX RayCaster clone source resolution

The implementation is well-structured and complete:

Component Status
Factory dispatch routing (_backend_class_names) ✅
OvPhysX sensor module (isaaclab_ovphysx.sensors.ray_caster) ✅
Mixin-based pose tracking via RIGID_BODY_POSE tensor binding ✅
Clone-plan source resolution (f4b6d4f fix) ✅
Velocity env preset (RoughPhysicsCfg.ovphysx) ✅
Unit test for clone-plan path ✅
Changelogs ✅

The final commit (f4b6d4f) addresses a key integration concern: the mixin now correctly resolves pose bindings through the shared _resolve_rigid_body_ancestor_expr() method, which properly handles clone-plan sources without requiring destination USD prims to exist. The accompanying test validates this behavior.

Recommendation: This implementation is ready for merge.


Reviewed at f4b6d4f


Update (706b1da): New commit adds proper per-environment offset alignment to OVPhysX binding row order. The refactored _resolve_offsets_in_binding_order method correctly maps sensor prim offsets to their corresponding RIGID_BODY_POSE binding rows, handling cases where OVPhysX may return environments in non-sequential order. New test validates this ordering behavior. No new issues introduced.

Previous suggestions status:

  • Multi-mesh test coverage: still a follow-up item (non-blocking)
  • Floor-division assertion: not yet added (non-blocking)

Recommendation remains: ready for merge.


Update (c5d2721): This commit reverses the per-environment offset alignment introduced in 706b1da. The complex _resolve_offsets_in_binding_order machinery (including _get_binding_prim_paths, _resolve_sensor_offsets_by_body_path, and _validate_binding_paths_match_glob) has been removed entirely. Offset initialization now simply replicates the fixed offset for all views.

Changes:

  • Removed ~75 lines of offset-resolution logic and the fnmatch import
  • Simplified _FakeBinding / _FakePhysx test fixtures
  • Removed the binding-order alignment test

Assessment: This simplification is reasonable if per-sensor-prim offsets are not needed for the initial version (single uniform offset per raycaster). It reduces complexity and potential failure modes. However, this means all environments must use identical sensor-to-body offsets — non-uniform offsets (e.g., sensors at different body-relative positions across envs) are no longer supported.

Previous suggestions status:

  • Multi-mesh test coverage: still a follow-up item (non-blocking)
  • Floor-division assertion: still not added (non-blocking), but less likely to trigger given simplified code path

Recommendation remains: ready for merge.


Update (b2313bf): Single new commit removes @pytest.mark.isaacsim_ci markers from all OVPhysX test files (articulation, rigid object, rigid object collection, contact sensor) since IsaacSim CI cannot run the OVPhysX backend. Pure test-configuration cleanup — no functional changes, no new issues.

Previous suggestions status:

  • Stale comment re: clone_usd=True: not addressed (non-blocking, original inline comment stands)
  • Floor-division assertion: not addressed (non-blocking, original inline comment stands)
  • Warp view() alignment: not addressed (non-blocking, original inline comment stands)
  • Multi-mesh test coverage: still a follow-up item (non-blocking)

Recommendation remains: ready for merge.


Update (22886c5): New commits add minor improvements to the OvPhysX raycaster: replaced manual destination.partition("{}") with the new shared split_clone_template() utility (cleaner, adds validation). Also removed redundant queue_usd_replication(cfg) calls from OvPhysX asset constructors (articulation, rigid_object, rigid_object_collection) — the USD replication is now handled at a higher level, avoiding duplicate work during scene cloning.

Previous suggestions status:

  • Stale comment re: clone_usd=True: not addressed (non-blocking, original inline comment stands)
  • Floor-division assertion: not addressed (non-blocking, original inline comment stands)
  • Warp view() alignment: not addressed (non-blocking, original inline comment stands)
  • Multi-mesh test coverage: still a follow-up item (non-blocking)

No new issues introduced. Recommendation remains: ready for merge.

@AntoineRichard
AntoineRichard force-pushed the antoiner/feat/ovphysx_raycaster branch from 1550bd8 to 027d979 Compare May 19, 2026 17:27
@greptile-apps

greptile-apps Bot commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds OVPhysX backend support for the four ray-caster sensor variants (RayCaster, RayCasterCamera, MultiMeshRayCaster, MultiMeshRayCasterCamera) via a shared _OvPhysxRayCasterMixin (~200 lines) that tracks body poses through RIGID_BODY_POSE tensor bindings, mirroring the PhysX backend's architecture. It also introduces OvPhysxFrameView, a Warp-native site-based view, and wires OvPhysxCfg into the locomotion velocity rough-terrain task config to unblock the Anymal-D task under presets=ovphysx.

  • _OvPhysxRayCasterMixin / sibling modules: Pose tracking dispatches to a live RIGID_BODY_POSE binding (dynamic bodies) or a one-time USD snapshot (static frames); multi-mesh dynamic targets create a second binding, limited to a single env-wildcard pattern in v1.
  • OvPhysxFrameView: Resolves USD prims to (body_index, site_local) pairs and computes world/local poses on-GPU via Warp kernels; defers initialization via PHYSICS_READY callback when PhysX isn't ready at construction time.
  • interactive_scene.py / ovphysx_manager.py: Switches clone_usd=True unconditionally so all backends get per-env USD prims for sensor discovery; compensates for OVPhysX by stripping env_1..N from the exported USD file before handing it to the wheel (_export_env0_only_stage).

Confidence Score: 4/5

Safe to merge with minor cleanup; the core pose-tracking and env-0-only export logic is sound and locally validated at 4096 envs.

The mixin and frame view follow established PhysX backend patterns. Three findings: a stale comment (harmless), an unguarded floor-division in multi-mesh transform update (silently wrong mesh count on misconfiguration), and an inconsistent wp.array.view() call on a 2D tensor. None affect the verified Anymal-D use case.

sensors/ray_caster/ray_caster.py for the mesh-count division and static-path warp reinterpretation; interactive_scene.py for the hedge comment.

Important Files Changed

Filename Overview
source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/ray_caster/ray_caster.py New _OvPhysxRayCasterMixin + RayCaster — well-structured, but a stale comment about env_0 USD prims and an unguarded integer division in _update_mesh_transforms are worth addressing.
source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/ovphysx_frame_view.py New OvPhysxFrameView — Warp-kernel site view with deferred init and well-documented v1 limitations. No critical issues.
source/isaaclab_ovphysx/isaaclab_ovphysx/physics/ovphysx_manager.py Adds _export_env0_only_stage to strip env_1..N from exported USD; logic is correct.
source/isaaclab/isaaclab/scene/interactive_scene.py Switches clone_usd to unconditional True with a hedge comment flagging the assumption as unverified.
source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/velocity_env_cfg.py Adds OvPhysxCfg import and ovphysx preset entry to RoughPhysicsCfg — minimal and correct.

Comments Outside Diff (1)

  1. source/isaaclab/isaaclab/scene/interactive_scene.py, line 166-180 (link)

    P2 Uncertainty acknowledged in production comment

    The inline comment says "Probing whether this assumption holds in practice; revert to not startswith('ovphysx') if physx.clone() errors on already-populated targets." The mitigating _export_env0_only_stage means the wheel never sees the full N-env USD, so real-world risk is low — but the hedge language is worth resolving before merge. Either confirm the assumption and remove the hedge, or add a tracking issue reference.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "Add isaaclab_ovphysx.sensors.ray_caster ..." | Re-trigger Greptile

Comment on lines +151 to +154
# Under OVPhysX ``clone_usd=True`` only env_0 carries USD prims (the
# env_1..N bodies are physics-layer clones created by physx.clone()),
# so a single discovered prim must be broadcast to ``self._view_count``
# offset rows. Same broadcast PhysX applies.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Stale comment after clone_usd=True change: the comment says "only env_0 carries USD prims (the env_1..N bodies are physics-layer clones)" but the interactive_scene.py change makes clone_usd=True unconditional, so all envs now have authored USD prims in the live stage. find_matching_prims will return one prim per env, and the broadcast branch (len == 1) will not fire. The comment documents a scenario that no longer applies, which would mislead future readers.

Suggested change
# Under OVPhysX ``clone_usd=True`` only env_0 carries USD prims (the
# env_1..N bodies are physics-layer clones created by physx.clone()),
# so a single discovered prim must be broadcast to ``self._view_count``
# offset rows. Same broadcast PhysX applies.
# With ``clone_usd=True`` every env has its own authored USD prim, so
# ``find_matching_prims`` returns one entry per env and the broadcast
# branch below (``len == 1``) is only hit in edge cases where a single
# sensor prim covers all envs (e.g. a global terrain marker).

Comment on lines +291 to +294
view_count = int(view.shape[0])
meshes_per_env = view_count
if view_count != 1:
meshes_per_env = view_count // self._num_envs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Integer floor-division without a divisibility check: if view_count is not an exact multiple of self._num_envs, meshes_per_env is silently truncated and the wp.launch processes fewer transforms than expected — remaining mesh slots stay at stale values with no warning. An assertion here would surface misconfiguration immediately.

Suggested change
view_count = int(view.shape[0])
meshes_per_env = view_count
if view_count != 1:
meshes_per_env = view_count // self._num_envs
view_count = int(view.shape[0])
meshes_per_env = view_count
if view_count != 1:
assert view_count % self._num_envs == 0, (
f"OvPhysxRayCaster: target binding shape {view_count} is not divisible "
f"by num_envs={self._num_envs}; mesh-transform kernel will process wrong count."
)
meshes_per_env = view_count // self._num_envs

Comment on lines +176 to +177
self._static_view_transforms_torch = torch.tensor(poses, dtype=torch.float32, device=self._device).contiguous()
self._static_view_transforms_wp = wp.from_torch(self._static_view_transforms_torch).view(wp.transformf)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 The static-path calls .view(wp.transformf) on a 2D (N, 7) float32 array, while the dynamic path uses the explicit wp.array(ptr=..., shape=(N,), dtype=wp.transformf) idiom. Aligning them avoids ambiguity in view() semantics on multi-dimensional arrays across Warp versions.

Suggested change
self._static_view_transforms_torch = torch.tensor(poses, dtype=torch.float32, device=self._device).contiguous()
self._static_view_transforms_wp = wp.from_torch(self._static_view_transforms_torch).view(wp.transformf)
self._static_view_transforms_torch = torch.tensor(poses, dtype=torch.float32, device=self._device).contiguous()
_static_buf = wp.from_torch(self._static_view_transforms_torch)
self._static_view_transforms_wp = wp.array(
ptr=_static_buf.ptr,
shape=(len(prims),),
dtype=wp.transformf,
device=str(_static_buf.device),
copy=False,
)

@AntoineRichard
AntoineRichard force-pushed the antoiner/feat/ovphysx_raycaster branch 2 times, most recently from a59b06d to b8dffa2 Compare May 20, 2026 05:22

@marcodiiga marcodiiga left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Superseded by the consolidated follow-up comment: #5691 (comment)

@marcodiiga
marcodiiga dismissed their stale review June 5, 2026 14:36

Reclassifying after a follow-up review: the multi-pattern OVPhysX limitation is real, but the cited Dexsuite path is not currently a supported/reached OVPhysX path, so this should not remain a request-changes blocker.

@marcodiiga

Copy link
Copy Markdown
Collaborator

Consolidating my earlier notes on the OVPhysX multi-mesh ray-caster path.

I do not think the documented multi-pattern limitation, by itself, should block the whole PR. The Anymal-D single-mesh height-scanner path is separate. The two concrete issues I would still address for the multi-mesh dynamic-target path are:

  1. A single env-wildcard dynamic target can be expanded into multiple concrete env patterns and rejected.

BaseMultiMeshRayCaster preserves ClonePlan-backed owner expressions such as the destination template plus owner suffix (source/isaaclab/isaaclab/sensors/ray_caster/base_multi_mesh_ray_caster.py:258) and returns those tracked expressions (base_multi_mesh_ray_caster.py:268-273). The OVPhysX override then immediately resolves each expression against live USD prims (source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/ray_caster/ray_caster.py:222-242). In clone-USD scenes, that means an env-wildcard target like /World/envs/env_.*/Object can become concrete paths like /World/envs/env_0/Object, /World/envs/env_1/Object, etc. _ovphysx_body_glob() only converts {} and .*, not concrete env_N segments (ray_caster.py:60-67), so the dedup at ray_caster.py:247 can see multiple patterns and raise the v1 multi-pattern NotImplementedError at ray_caster.py:248-253 even though this is one body type across envs.

Please preserve the ClonePlan wildcard expression, or collapse cloned env paths back to one ovphysx wildcard before the pattern-dedup check. A targeted test with one env-wildcard, single-body dynamic target would cover this.

  1. Dynamic-target bindings are not destroyed on invalidation.

_invalidate_initialize_callback() calls super()._invalidate_initialize_callback(event) first (ray_caster.py:311-313). For MultiMeshRayCaster, the base callback clears self._mesh_views (base_multi_mesh_ray_caster.py:462-466) before the OVPhysX loop tries to destroy the tracked-target bindings (ray_caster.py:320-322). That makes the destroy loop iterate an empty list, so the TensorBinding handles created by _create_tracked_target_view() (ray_caster.py:255-261) can leak across sim stop/reinit.

Please snapshot/destroy _mesh_views before calling super(), or otherwise ensure backend-specific cleanup runs before the base class clears the list.

@marcodiiga

Copy link
Copy Markdown
Collaborator

One more OVPhysX RayCaster pose-tracking issue: this path appears to assume that the RIGID_BODY_POSE binding row order matches the USD prim/env order returned by find_matching_prims().

_initialize_pose_tracking() creates the binding from body_glob, then builds offset_pos / offset_quat by iterating the USD prims list. Later _get_view_transforms_wp() reads the binding into transforms, and update_ray_caster_kernel indexes transforms[env_id] together with offset_pos[env_id]. If the OVPhysX binding row order differs from USD discovery order, the sensor applies the wrong per-env offset to the body transform. There is also no validation that the binding row count/order matches the resolved sensor prims.

Other OVPhysX code that consumes RIGID_BODY_POSE, such as OvPhysxFrameView, uses binding.prim_paths to map body paths to binding rows before building indices. Can this raycaster path either build offsets in binding-row order using prim_paths, or add a hard validation that the binding rows match the expected env/body order? A multi-env test with distinct per-env sensor offsets would catch this.

Without an 'ovphysx' field on RoughPhysicsCfg, 'presets=ovphysx' falls
back to the 'default' PhysxCfg for the physics stack while still picking
the ovphysx ContactSensor (which we already wired into
VelocityEnvContactSensorCfg).  The OvPhysx ContactSensor's
_initialize_impl then calls OvPhysxManager.get_physx_instance() and
raises 'OvPhysxManager has not been initialized yet.' on PhysX-backed
rough envs (e.g. Isaac-Velocity-Rough-Anymal-D-v0).

Add OvPhysxCfg() to RoughPhysicsCfg so 'presets=ovphysx' selects the
ovphysx physics stack for rough locomotion the same way it already does
for the AnymalD flat env.
Add the ``ovphysx`` entry to the four core
``isaaclab.sensors.ray_caster.*`` factory classes so calls to
``RayCaster(cfg)`` (and the three siblings) under an OVPhysX
``SimulationContext`` return the corresponding class in
``isaaclab_ovphysx.sensors.ray_caster`` rather than raising
``ModuleNotFoundError``.
Mirror the per-backend RayCaster structure introduced by PR isaac-sim#5510 for
the OVPhysX backend: a single ``_OvPhysxRayCasterMixin`` (~200 lines)
in ``ray_caster.py`` carries the backend-specific pose-tracking
surface, reading live body poses through the ovphysx wheel's
``create_tensor_binding(pattern=..., tensor_type=RIGID_BODY_POSE)``
API. Three 14-line sibling modules compose the mixin with the matching
``Base*`` class (RayCasterCamera, MultiMeshRayCaster,
MultiMeshRayCasterCamera).

Static (non-physics) sensor frames fall back to a one-time USD pose
snapshot, matching PhysX's ``_initialize_static_pose_tracking``. Under
OVPhysX ``clone_usd=True`` scenes where only env_0 carries USD prims,
the env_0 offset is broadcast across the binding's row count (same
broadcast PhysX applies).

Multi-mesh dynamic targets create a second binding via the same
``create_tensor_binding`` call. v1 limitation: target paths must dedup
to a single env-wildcard pattern; multi-pattern targets raise
``NotImplementedError`` (mirrors the OVPhysX ContactSensor
``track_pose`` single-body constraint).

Unblocks ``Isaac-Velocity-Rough-Anymal-D-v0 presets=ovphysx`` (the
height_scanner is a RayCaster).
Reuse the shared SensorBase rigid-body ancestor resolver so OVPhysX RayCaster pose bindings resolve from clone-plan sources instead of destination USD prims that may not exist under solver-side cloning.

Add a focused regression covering the missing-destination-USD path with a mocked OVPhysX binding.
@AntoineRichard
AntoineRichard force-pushed the antoiner/feat/ovphysx_raycaster branch from b8dffa2 to f4b6d4f Compare June 9, 2026 13:39
Map sensor offsets by rigid-body prim path and build the Warp arrays in OVPhysX RIGID_BODY_POSE binding order.

This keeps per-env offsets aligned when binding rows are not returned in USD discovery order and validates the binding prim_paths count and pattern.
@AntoineRichard

Copy link
Copy Markdown
Collaborator Author

Follow-up on the OVPhysX RayCaster pose-tracking offset ordering concern: PhysX RayCaster does not currently support distinct per-env sensor-to-body offsets either. It resolves the source-side sensor offset and broadcasts that across the rigid-body view rows.

Keeping OVPhysX aligned with that backend contract is the intended scope for this PR, so adding binding-row-specific/per-env-authored offsets is out of scope here. If we want that behavior later, it should be added consistently across RayCaster backends with shared contract coverage.

Drop isaacsim_ci marks from OVPhysX tests because IsaacSim CI cannot run the OVPhysX backend.
@isaaclab-review-bot

Copy link
Copy Markdown
Contributor

Follow-up Review: Commits c5d2721..22886c5

The branch has been updated with a merge from develop and several commits. Here's the incremental assessment:

New Commits Reviewed

SHA Title Assessment
5124aa17 Fix sensor ancestor suffix trimming (#6068) ✅ Improves robustness of _resolve_rigid_body_ancestor_expr() by validating suffix before string replacement
166f3148 Fix kitless OVPhysX scene cloning (#6072) ✅ Introduces split_clone_template() helper; consolidates template parsing across cloner modules
b2313bfe Remove OVPhysX tests from IsaacSim CI ✅ Test configuration cleanup (removes @pytest.mark.isaacsim_ci markers)
22886c5b Merge develop into branch ✅ Brings in upstream changes (Docker, CI, Newton fixes)

Notable Changes

1. Sensor Base Fix (5124aa1)
The sensor_base.py change adds proper validation before suffix trimming:

suffix = "/" + relative_path
if not target_expr.endswith(suffix):
    raise RuntimeError(...)
rigid_parent_expr = target_expr[: -len(suffix)]

This prevents silent misalignment when the target expression doesn't match expected structure.

2. Clone Template Helper (166f314)
New split_clone_template() centralizes parsing of destination templates with {} placeholders. Used by:

  • clone_plan.py
  • cloner_utils.py
  • usd.py
  • replicate.py (OVPhysX)
  • ray_caster.py (Newton)

Also improves usd_replicate() to only author positions/quaternions for instance-root destinations (avoids overwriting nested prim transforms).

3. OVPhysX Asset Cleanup
Removed redundant queue_usd_replication(cfg) calls from OVPhysX Articulation and RigidObjectCollection — the backend-specific queue_ovphysx_replication() handles replication appropriately.

Previous Inline Comments Status

The three P2 suggestions from the prior review have not been addressed in these commits:

  1. ⏳ Stale clone_usd comment (line 154 area) — original comment was about documentation; the raycaster file is unchanged
  2. ⏳ Floor-division assertion (line 262) — still no divisibility check before view_count // self._num_envs
  3. ⏳ Warp .view() alignment (line 145) — static path still uses .view(wp.transformf) instead of explicit wp.array(ptr=...)

These remain non-blocking suggestions for a follow-up.

Summary

No new issues introduced. The bug fixes in sensor_base.py and cloner modules strengthen the OVPhysX RayCaster integration by improving the underlying infrastructure it depends on. The raycaster implementation itself is unchanged.

Recommendation remains: ready for merge.


Reviewed at 22886c5

@marcodiiga marcodiiga left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving after re-review. Existing review comments still stand where applicable.

@AntoineRichard
AntoineRichard merged commit 945e903 into isaac-sim:develop Jun 17, 2026
37 checks passed
matthewtrepte pushed a commit to matthewtrepte/IsaacLab that referenced this pull request Aug 4, 2026
# Description

Adds `isaaclab_ovphysx.sensors.ray_caster` so `RayCaster(cfg)`,
`RayCasterCamera`, `MultiMeshRayCaster`, and `MultiMeshRayCasterCamera`
dispatch correctly under an OVPhysX `SimulationContext`. Unblocks
`Isaac-Velocity-Rough-Anymal-D-v0` under `presets=ovphysx` (the
height_scanner is a `RayCaster`).

Mirrors `isaaclab_physx.sensors.ray_caster` structure: a single
`_OvPhysxRayCasterMixin` (~200 lines in `ray_caster.py`) carries the
backend-specific pose-tracking surface, reading live body poses via the
ovphysx wheel's
`create_tensor_binding(pattern=..., tensor_type=RIGID_BODY_POSE)` API.
Three 14-line sibling modules compose the mixin with the matching
`Base*` class. Static (non-physics) sensor frames fall back to a
one-time USD pose snapshot, matching PhysX's
`_initialize_static_pose_tracking`.

Multi-mesh dynamic targets create a second binding via the same
`create_tensor_binding` call. v1 limitation: target paths must dedup
to a single env-wildcard pattern; multi-pattern targets raise
`NotImplementedError` (mirrors the OVPhysX `ContactSensor`
`track_pose` single-body constraint).

Also wires `isaaclab_ovphysx.sensors.ContactSensorCfg` and
`isaaclab_ovphysx.physics.OvPhysxCfg` into the shared
`LocomotionVelocityRoughEnvCfg.RoughPhysicsCfg` so
`Isaac-Velocity-Rough-Anymal-D-v0` can pick the right preset under
`presets=ovphysx`.

Built on top of isaac-sim#5678 (FrameView, **now merged**). Anymal-D Rough at
4096 envs needs FrameView's `clone_usd=True` + env_0 USD stripping to
avoid a wheel-side hang during init; with isaac-sim#5678 in develop, this PR is
now a standalone three-commit diff:

- `Wire OvPhysX preset into shared RoughPhysicsCfg`
- `Route RayCaster dispatch to ovphysx backend`
- `Add isaaclab_ovphysx.sensors.ray_caster package`

Verified locally:

- `./isaaclab.sh -p scripts/environments/random_agent.py --task
Isaac-Velocity-Rough-Anymal-D-v0 --num_envs 64 --headless
presets=ovphysx` reaches the agent loop cleanly.
- `./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/train.py
--task Isaac-Velocity-Rough-Anymal-D-v0 --num_envs 4096 --max_iterations
100 --headless presets=ovphysx` completes 100 iterations with
non-degenerate mean reward.

Fixes # (issue)

## Type of change

- New feature (non-breaking change which adds functionality)

## Screenshots

N/A — backend dispatch + sensor implementation, no UI surface.

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants