Skip to content

Fix ray-caster mounts through shared frame views - #9062

Merged
ooctipus merged 5 commits into
isaac-sim:mainfrom
yts-nv:fix/kuka-raycaster-camera-mount
Dec 3, 2026
Merged

ooctipus merged 5 commits into
isaac-sim:mainfrom
yts-nv:fix/kuka-raycaster-camera-mount

Conversation

@yts-nv

@yts-nv yts-nv commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Kuka-Allegro Lift and Reorient ray-caster presets point at /Camera prims that only rendered cameras spawn. Scene creation fails with No prim found .../Camera. Correcting the paths alone still leaves OVPhysX base cameras at authored USD positions instead of their cloned environment positions.

The configuration now names an existing mount and its offset. OVPhysX and Newton ray casters obtain that mount's pose through the existing FrameView; the sensor only applies its offset and casts rays.

  • Set the Kuka mounts to the environment root and palm link, with explicit 2.5 m depth clipping.
  • Resolve environment-root frames through clone placements. Frame views own ancestry, destination ordering, and body/world attachment.
  • Expose borrowed Warp transforms from frame views. OVPhysX frame views reuse shared scene-data publications; body-frame reads borrow their poses directly, and composed frames share storage with the existing pose outputs.
  • Remove both sensor pose mixins, Newton ray-caster site registration and pose kernels, OVPhysX per-view native pose bindings, and the now-unused per-world site-injection machinery. IMU, PVA, and frame-transformer site registration remains in use.
  • Preserve infinite missed-ray depth before clipping, avoiding NaN from inf * 0 during projection.

Production code is net −256 lines relative to a691e2c34. Coverage extends existing tests; no new test files or lifecycle hooks. Documentation and package changelog fragments are included. No unmerged dependencies.

Custom ray-caster configurations must name existing mount frames. Newton ray-caster poses are available through sensor.data.pos_w / quat_w; the sensor-specific pose getter was removed with its mixin.

Validation

Reproduced before fixing:

  • Actual Lift scene fails at the missing /Camera path; config-only correction leaves camera positions wrong by up to 1.5 m.
  • Existing frame-view tests detect missing clone expansion (OVPhysX: 2 roots instead of 12; Newton: 1 instead of 4).
  • The missed-ray test returns NaN without the kernel fix. Freezing OVPhysX frame poses makes the native-write regression fail.

With the fix:

  • 130 passed across frame views (45 Newton, 38 OVPhysX), ray casters (8 Newton, 2 OVPhysX), ray-caster kernels (17), site injection/hard resets (10), and clone labels (10).
  • OVPhysX frame-view contract tests now move parents through the real asset API instead of bypassing native reads with a fixture buffer.
  • Actual Lift and Reorient on OVPhysX and Newton MJWarp, plus Lift on Newton Steel: 4 environments, both cameras, 64×64 depth, reset and two steps. Checked mount placement, wrist attachment, and finite depth within 2.5 m.
  • USD packed-transform reads and the writer guard checked directly. Full uv run isaaclab --format passed.

Isaac Sim/Kit was unavailable locally. Its separate ray-caster adapter is unchanged by the frame-tracking consolidation and remains unvalidated here. Task checks are short rollouts, not training benchmarks.

CI follow-up validation

Camera pose conversion now uses Warp views to preserve the row strides of the shared transform buffer. The previous raw-pointer conversions read the wrong positions and quaternions after the first camera. The existing lighting regression reproduced this failure before the fix; all seven previously failing Newton image comparisons pass with unchanged reference images and tolerances.

Consolidated the packed-transform buffer and writer-guard assertions into the existing frame-write test, which uses the supported writer API. Updated and consolidated depth-clipping assertions to require infinite missed-ray distances before clipping, rather than NaNs.

  • 111 existing tests passed: 45 Newton frame-view cases, 38 OVPhysX frame-view cases, 17 ray-caster kernel cases, 3 lighting cases, 7 Newton image comparisons, and the exact H1 demo smoke test that timed out in CI (passed locally in 64 seconds).
  • The consolidated USD frame-write contract passed on CPU and both GPUs; the exact updated depth-clipping test body also passed with OVPhysX.
  • Full repository formatting and lint checks passed.
  • Isaac Sim/Kit remains unavailable locally. Additional standalone RTX validation was blocked locally in native stage attachment; the complete rendering and Fabric jobs still need CI confirmation.

Type of change

  • Bug fix and consolidation of frame tracking

Release backport

  • Backport to 3.1 after merging into main

Checklist

  • Read the contribution guidelines
  • Run repository formatting and lint checks
  • Update documentation
  • Validate behavior and consolidate coverage in existing tests
  • Add changelog fragments for each touched package

@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Nov 17, 2026
@ooctipus
ooctipus force-pushed the fix/kuka-raycaster-camera-mount branch from fc174df to 8d40f0f Compare December 2, 2026 00:09
@ooctipus ooctipus changed the title Mount Kuka ray-caster cameras on existing prims Fix Kuka ray-caster mounts through configuration and frame views Dec 2, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Dec 2, 2026
@ooctipus ooctipus changed the title Fix Kuka ray-caster mounts through configuration and frame views Fix ray-caster mounts through shared frame views Dec 2, 2026
@yts-nv
yts-nv marked this pull request as ready for review December 2, 2026 01:53
@yts-nv
yts-nv requested a review from a team December 2, 2026 01:53

@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.

Isaac Lab Review Bot

Needs attention: Compatibility and deprecation (6), Style consistency (5), Test quality (2). Other reviewed categories look good.

  • PR description: The title and validation scope match the diff; document site API migrations and make the reported OVPhysX latency comparison reproducible with revisions, command, hardware, backend, runtime, environment count, and warmup.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: Sensor pose/count accessors, tracker overrides, root-site replication input, per-world registration, and injection return arity lose compatibility; retain functional bridges with targeted warnings, migration/removal guidance, and transition coverage.
  • Implementation: Implementation looks good.
  • Style consistency: The new transform getter omits shape, translation units, and complete guard documentation; document those contracts and backend ownership, and use the required relative Newton physics import.
  • Test quality: Added AST checks constrain private implementation rather than behavior; remove them and run the backend-independent root assertion once, retaining distinct frame, native-write, clipping, and reset regressions.

Significant concerns. Posted 13 inline findings.

Automated review; human maintainers own approval decisions.

if not hasattr(self, "_view_count"):
view: Any = self._view
self._view_count = view.count
self._view_count = self._view.count

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.

🟡 Warning · Compatibility — Preserve documented tracker overrides

The former hook explicitly allowed subclasses to set _view_count and override transform acquisition without _view. Requiring _view.count breaks those extensions; retain the count fallback during deprecation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No deprecation shims, following how main removed cl_register_site (Breaking changelog entry). The removals are recorded as Breaking with migration notes in isaaclab_newton and isaaclab_ov (*.removed.rst + .major): sensor poses from sensor.data.pos_w / quat_w and sensor.num_instances instead of the sensors' get_world_poses() / count; environment-root frames via FrameView instead of per_world sites (register_site, inject_sites' third result, env_root_sites). The _initialize_pose_tracking / _view_count hook is private. Maintainers, please say if you prefer deprecation bridges for the sensor accessors, which shipped in v3.0.0.

self._assert_no_active_writer("get_world_poses")
return self._get_world_poses_impl(indices)

def get_world_transforms(self) -> ProxyArray:

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.

🟡 Warning · Style Consistency — List the guarded transform getter

The class contract enumerates getters blocked during a writer scope but omits this new getter. Add it to that list so the documented guard matches the API.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done: get_world_transforms is listed among the guarded getters, and its docstring gives shape (N,), dtype wp.transformf, translation in metres and buffer ownership.

return self._get_world_poses_impl(indices)

def get_world_transforms(self) -> ProxyArray:
"""Get world poses as an array of Warp transforms in ``(x, y, z, qx, qy, qz, qw)`` order.

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.

🟡 Warning · Style Consistency — Specify transform shape and units

The new public getter describes element order but not the returned shape or translation units. Document the [N] Warp-transform array and metre-valued translation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done: get_world_transforms is listed among the guarded getters, and its docstring gives shape (N,), dtype wp.transformf, translation in metres and buffer ownership.

for path in consumers:
for node in ast.walk(ast.parse(path.read_text())):
if isinstance(node, ast.ClassDef):
assert node.name not in {"_NewtonRayCasterPoseMixin", "_OvPhysxRayCasterMixin"}, path

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.

🟡 Warning · Test Quality — Remove private-name source checks

The added AST checks ban private names and call locations, so behavior-preserving refactors fail. Remove them; the sensor and frame-view tests check the observable tracking contract.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the added private-name checks; the test is back to main's version.

source_inverse: dict[str, np.ndarray],
env_ids: np.ndarray,
source_site_indices: dict[int, dict[str, list[int]]] | None = None,
env_root_sites: dict[str, wp.transform] | None = None,

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.

🟡 Warning · Compatibility — Retain root-site replication input

Removing env_root_sites makes existing replicate_builder_mapping calls fail and prevents their world-site replication. Accept and apply the argument through a documented, tested deprecation cycle.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No deprecation shims, following how main removed cl_register_site (Breaking changelog entry). The removals are recorded as Breaking with migration notes in isaaclab_newton and isaaclab_ov (*.removed.rst + .major): sensor poses from sensor.data.pos_w / quat_w and sensor.num_instances instead of the sensors' get_world_poses() / count; environment-root frames via FrameView instead of per_world sites (register_site, inject_sites' third result, env_root_sites). The _initialize_pose_tracking / _view_count hook is private. Maintainers, please say if you prefer deprecation bridges for the sensor accessors, which shipped in v3.0.0.



class NewtonRaycastSensor(_NewtonRayCasterPoseMixin, BaseRayCaster):
class NewtonRaycastSensor(BaseRayCaster):

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.

🟡 Warning · Compatibility — Retain Newton sensor pose access

Removing the mixin drops get_world_poses(indices) and count from native and legacy Newton ray casters. Keep compatible accessors through a documented deprecation cycle with targeted warnings and old/new tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No deprecation shims, following how main removed cl_register_site (Breaking changelog entry). The removals are recorded as Breaking with migration notes in isaaclab_newton and isaaclab_ov (*.removed.rst + .major): sensor poses from sensor.data.pos_w / quat_w and sensor.num_instances instead of the sensors' get_world_poses() / count; environment-root frames via FrameView instead of per_world sites (register_site, inject_sites' third result, env_root_sites). The _initialize_pose_tracking / _view_count hook is private. Maintainers, please say if you prefer deprecation bridges for the sensor accessors, which shipped in v3.0.0.

# Backend hooks
# ------------------------------------------------------------------

def get_world_transforms(self) -> ProxyArray:

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.

🟡 Warning · Style Consistency — Document Newton's borrowed transform buffer

This public override lacks a docstring explaining that reads refresh and return view-owned storage. Add the ownership and update behavior at the override.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The overrides are removed; the base docstring covers ownership.



class RayCaster(_OvPhysxRayCasterMixin, BaseRayCaster):
class RayCaster(BaseRayCaster):

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.

🟡 Warning · Compatibility — Retain OVPhysX sensor pose access

Removing this mixin drops get_world_poses(indices) and count from OVPhysX ray-caster variants. Keep compatible accessors through a documented deprecation cycle with targeted warnings and old/new tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No deprecation shims, following how main removed cl_register_site (Breaking changelog entry). The removals are recorded as Breaking with migration notes in isaaclab_newton and isaaclab_ov (*.removed.rst + .major): sensor poses from sensor.data.pos_w / quat_w and sensor.num_instances instead of the sensors' get_world_poses() / count; environment-root frames via FrameView instead of per_world sites (register_site, inject_sites' third result, env_root_sites). The _initialize_pose_tracking / _view_count hook is private. Maintainers, please say if you prefer deprecation bridges for the sensor accessors, which shipped in v3.0.0.

# Backend hooks
# ------------------------------------------------------------------

def get_world_transforms(self) -> ProxyArray:

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.

🟡 Warning · Style Consistency — Document OVPhysX transform ownership

This public override returns either a scene-data publication or view-owned storage without documenting that distinction. State the borrowed-buffer behavior at the override.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The overrides are removed; the base docstring covers ownership.


name = "WorldCamera_1/Frame" if repeated else "WorldCamera/Frame"
view = FrameView(f"/World/envs/env_[^/]+/{name}", device=device)
roots = FrameView("/World/envs/env_[^/]+", device=device)

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.

🟡 Warning · Test Quality — Check root expansion once

Both repeated-asset rows construct and assert the same environment-root view; that parameter changes only the nested asset. Run this root assertion in one row.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The environment-root check now runs only in the non-repeated row.

@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5RetriggerView in Greptile

[Medium impact] The changes reach ray-caster mount tracking across OVPhysX and Newton, plus the Kuka-Allegro camera presets.

Update the stale inject_sites test mock before merging; it breaks six existing test cases.

Findings

  1. P1 Global-import tests now fail ▶

Summary

Moves OVPhysX and Newton ray-caster mounts into shared frame views.

  • OVPhysX and Newton ray casters now follow configured mounts across clones.
  • Missed camera rays keep their depth until clipping applies.

Intentional changes acknowledged by yts-nv: missing-mount name inference and the Newton sensor-specific pose getter were removed. The PR description directs callers to existing mounts and sensor.data poses. yts-nv also states that the unchanged Isaac Sim adapter was not locally validated.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Existing mount] --> B[FrameView]
  C[Clone placements] --> B
  D[Shared body poses] --> B
  B --> E[World transforms]
  E --> F[Sensor offset and rays]
  F --> G[Ray cast]
  G --> H[Depth projection and clipping]
Loading

Reviews (1) · Last reviewed commit: "Centralize ray-caster mount tracking in ..." · Reviewed by Greptile

for source in owners:
add_deformable_from_usd(source, stage, entry, color)
global_sites, source_sites, root_sites = sim.backend_manager.inject_sites(builder, source_builders)
global_sites, source_sites = sim.backend_manager.inject_sites(builder, source_builders)

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.

P1 Global-import tests now fail

test_explicit_global_import_uses_global_world still mocks inject_sites with ({}, {}, {}). This changed unpack expects two values, so all six test cases now raise ValueError: too many values to unpack (expected 2) before reaching their assertions. Update the mock to return ({}, {}) alongside this return-shape change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: the inject_sites mock in test_newton_builder_world_hook.py returns two results; the file passes.

@StafaH StafaH 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.

Thanks, good consolidation: ray-caster pose tracking now goes through FrameView, OVPhysX reads one shared publication, and the mixins and site-injection machinery are gone. My comments are mostly about where code lives and whether the backends behave the same:

# Concern
1 Base get_world_transforms allocates (torch.cat + from_torch) per call; move the persistent transformf buffer + strided pos/quat views into BaseFrameView and drop both overrides
2 Env-root matching is duplicated in the Newton/OVPhysX views, and the two handle no-match differently
3 get_world_transforms overrides differ in guards and buffer ownership
4 Identity offset buffers still composed per ray on the frame-view path
5 Nits: unused preallocation, all([]), mount error message, changelog note for the depth clipping change

Checked: OVPhysX frame reads still refresh kinematics after writes (the publication runs pre_render() → update_kinematics() when the timestamp changes), so removing the explicit call is fine.

self._assert_no_active_writer("get_world_poses")
return self._get_world_poses_impl(indices)

def get_world_transforms(self) -> ProxyArray:

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.

Every call does a torch.cat and a wp.from_torch, and ray casters call this on every update. So the USD/Fabric views allocate each step, and this Warp path goes through Torch (Torch is also a new import here).

Newton (newton_site_frame_view.py:504) and OVPhysX (ovphysx_frame_view.py:482) each wrote the same fix separately: a persistent transformf buffer, with _pos_buf/_quat_buf as strided views into it. Could that live here in BaseFrameView? Then every backend returns a buffer that stays in place and never allocates, and both overrides go away. It would also be simpler for the site kernel to write transformf directly instead of writing the pos and quat views separately.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 60d4af0. BaseFrameView now owns the transformf buffer. Newton and OVPhysX write their poses into its strided views (_allocate_world_pose_buffers), so get_world_transforms returns it as is. USD/Fabric poses are packed into the same persistent buffer by a Warp kernel (no Torch, no per-call allocation). Both overrides are gone. A new contract test checks that the buffer stays in place across calls.

self._source_sites = []
self._prims: list[Usd.Prim] = []
if matches:
world_match = cloner.path.match(prim_path, plan.env_template) if plan is not None else None

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.

This env-root match is the same as newton_site_frame_view.py:323, but behaves differently when nothing matches: here raise_when_no_match=False leaves _prims empty, and from reading the code, init then fails later with an unclear unpacking error on the empty zip(*sites). Newton raises right away. Could this be one shared helper (e.g. in cloner) with a single clear error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done: cloner.path.get_root_worlds(plan, expr) is shared by both views. It returns the world ids, or None for an expression that is not an environment root. When the expression names no cloned environment (e.g. env_99 of 4) it raises one ValueError, so OVPhysX no longer fails later on an empty unpack.

specs.extend((expression_index, self._resolve_source_prim(prim, *source_args)) for prim in prims)
continue

world_match = cloner.path.match(path_expr, plan.env_template) if plan is not None else None

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.

Same block as ovphysx_frame_view.py:328; see the comment there about sharing one helper.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 60d4af0 with the same shared helper as the OVPhysX thread: cloner.path.get_root_worlds(plan, expr) returns the world ids, or None for a non-root expression, and raises one ValueError when the expression names no cloned environment.

# Backend hooks
# ------------------------------------------------------------------

def get_world_transforms(self) -> ProxyArray:

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.

The backends' overrides don't follow the same contract. This one calls _assert_no_active_writer/_require_initialized and Newton's (:649) doesn't. The body-view path here returns the shared publication buffer, while the other paths return the view's own buffer. A single implementation in the base (see base_frame_view.py:164) would remove the mismatch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done: the single implementation is in the base class (writer guard included; OVPhysX's initialization check runs in _get_world_poses_impl). The OVPhysX body-view path that returned the publication buffer is removed, so every backend returns its view-owned buffer.

identity_xform7 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0]

self._contains_physics_frames = any(prim.HasAPI(UsdPhysics.RigidBodyAPI) for prim in self._prims)
self._is_body_view = all(prim.HasAPI(UsdPhysics.RigidBodyAPI) for prim in self._prims)

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.

nit: all(...) is True when there are no prims, so an empty view counts as a body view. Only reachable together with the no-match case above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed along with the body-view path; an empty match now raises in get_root_worlds or the existing "matched zero prims" check.

self._body_count = len(body_paths)
self._body_mapping = self._scene_data_provider.create_mapping(body_paths) if body_paths else None
self._body_transforms = SceneDataFormat.Transform()
self._body_transforms.transforms = wp.empty(self._body_count, dtype=wp.transformf, device=self._device)

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.

nit (from reading the code, not run): with passthrough, get_transforms binds the provider's cached buffer and replaces this array, so this allocation looks unused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now a zero-length placeholder: reads bind the publication, and only a view of static frames (no bodies) keeps it.

raise NotImplementedError(f"{self.__class__.__name__} must initialize backend pose tracking.")
"""Resolve the configured mount through the backend frame view."""
self._view = sim_utils.FrameView(self.cfg.prim_path, device=self._device)
self._offset_pos_wp = wp.zeros(self._view.count, dtype=wp.vec3f, device=self._device)

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.

With frame views, these offsets are now always zero/identity (cfg.offset is already applied to ray_starts), but update_ray_caster_kernel still reads and composes them for every (env, ray). The Kit adapter still sets real offsets, so the kernel needs the inputs. On the frame-view path, though, they could become a no-offset kernel variant, or the offset could move into the frame view.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, but left for a follow-up: the ray-caster camera writes real offsets into these buffers (base_ray_caster_camera.py, set_world_poses), so they are not always identity on the frame-view path. A no-offset kernel variant can come with that follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried it and measured before deciding: a no-offset variant of update_ray_caster_kernel (sharing the per-ray body through a wp.func) makes the update kernel itself faster, but the mesh ray cast that follows dominates the sensor update:

GPU update kernel update + ray cast
RTX PRO 6000 Blackwell (bare metal) 2–12% faster (1.7–21 µs) 0.03–0.19% faster
L40 (container) 0.4–14% faster (0.6–85 µs) ≤0.36% faster

(4096×187 to 1024×16384 rays, world/yaw/base alignment, ~520k-triangle terrain.)

So I kept a single kernel: every ray caster stays on one code path, and the cameras and the Isaac Sim rigid-body mount, which write real offsets, keep sharing it. Happy to revisit if profiling shows otherwise.

"""
raise NotImplementedError(f"{self.__class__.__name__} must initialize backend pose tracking.")
"""Resolve the configured mount through the backend frame view."""
self._view = sim_utils.FrameView(self.cfg.prim_path, device=self._device)

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.

Dropping the fallback that attached a camera/raycaster child to its parent is the right simplification. Could the error a user now hits mention it? Currently it's just FrameView '...' could not resolve a source prim; adding something like "ray casters require an existing mount frame; set prim_path to the mount and use offset" would point them to the fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done: a mount that cannot be resolved now raises " could not resolve its mount '<prim_path>': Ray casters spawn no prim and require an existing mount frame: set prim_path to that frame (a rigid body, a static prim or the environment root) and place the sensor with offset."

disp_cam = wp.quat_rotate_inv(quat_w[env], disp_w)
value = disp_cam[0]
value = depth
if not wp.isinf(depth):

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.

Nice: shorter, gives the same result for finite depths, and avoids the inf * 0 NaN.

),
mesh_prim_paths=RAYCASTER_CAMERA_MESH_PRIM_PATHS,
max_distance=2.5,
depth_clipping_behavior="max",

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.

This changes the observation values for these tasks (misses clip to 2.5 instead of inf). Worth a line in the task changelog, since existing checkpoints would see different inputs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added isaaclab_tasks/changelog.d/fix-kuka-raycaster-camera-mount.changed.rst: missed rays now clip at 2.5 m instead of being non-finite, so policies trained before see different inputs for missed rays.

…atch

- BaseFrameView.get_world_transforms returns one view-owned wp.transformf
  buffer, refreshed in place: backends that write poses into the views of
  _allocate_world_pose_buffers (Newton, OVPhysX) need no packing, others are
  packed by a kernel without torch or per-call allocation. The Newton and
  OVPhysX overrides, and OVPhysX's separate body-view publication path, are
  removed, so every backend follows the same guards and buffer ownership.
- cloner.path.get_root_worlds resolves environment-root expressions for the
  Newton and OVPhysX frame views, with one error for an expression that names
  no cloned environment (e.g. env_99 of four).
- Ray casters whose mount cannot be resolved say that they need an existing
  mount frame and an offset.
- Tests: the stale inject_sites mock returns two results; a frame-view
  contract test checks the transform buffer stays in place and is guarded by
  writer scopes; the private-name AST checks are removed; the environment-root
  check runs once.
- Changelog: breaking removals with migration notes, the new public helpers,
  and the changed Kuka depth observations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ooctipus

ooctipus commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Dec 2, 2026
@ooctipus
ooctipus merged commit 8cee60b into isaac-sim:main Dec 3, 2026
94 of 96 checks passed
kellyguo11 added a commit that referenced this pull request Dec 3, 2026
…ion (#9368)

## Description

Backport fourteen merged PRs to `release/3.1.0`:

| Original PR | Change |
| --- | --- |
| #9359 | Let CI recover after Warp and OVRTX cache eviction; allow
cold-cache demo startup. |
| #9292 | Detect UTF-8 and BOM-marked UTF-16 YAML input and write UTF-8
independently of the system locale. |
| #9346 | Update the Isaac Sim CI image digest to `6745f1725c9b`. |
| #9334 | Bind cloned deformable state and materials in clone-plan
environment order. |
| #9172 | Update and pin setup-uv and cache actions in performance CI. |
| #9062 | Resolve ray-caster mounts through shared frame views and fix
Kuka-Allegro camera mounts and missed-ray clipping. |
| #9247 | Use floating-point digital-filter coefficients when
configuration literals are integers. |
| #9285 | Support scalar shapes in uniform, triangular, and log-uniform
random sampling. |
| #9333 | Initialize OVPhysX physics consumers and joint-wrench bindings
before deferred render cloning. |
| #9366 | Add the success-guided reset sampling paper citation to the
NIST package docstring. |
| #9369 | Mark ARM64 OptiX rendering tests as expected failures without
starting the unsupported runtime. |
| #9365 | Fix documented GR00T N1.7 installation with explicit tyro and
Git LFS/source-override handling. |
| #9270 | Upgrade Newton, MuJoCo/MuJoCo Warp 4.1, Warp 1.20, USD
schemas, and LEAPP, with required runtime and converter compatibility
changes. |
| #9317 | Preserve convex-hull collider types when constructing the
implicit MPM solver. |

Cherry-picked with `-x`, preserving one commit per source PR. The first
six were applied in merge order (#9334, #9062, #9292, #9359, #9346,
#9172), followed by #9247, #9285, #9333, #9366, #9369, #9365, #9270, and
#9317. All fourteen applied without conflicts or manual edits. Every
stable patch ID matches its original merge commit. Original
documentation, regression tests, and changelog fragments are preserved.

### Compatibility

These are the original PRs in full, including their compatibility
changes and version markers:

- #9292: legacy locale-encoded YAML must be converted to UTF-8.
- #9062: ray casters require an existing mount frame; the old
Newton/OVPhysX synthetic mounting behavior is removed. The shared
FrameView transform API is added. Kuka-Allegro missed rays now clip at
2.5 m, changing observations seen by previously trained policies.
- #9333: removes unreleased internal binding-event plumbing; public
`PhysicsEvent.PHYSICS_READY` subscriptions and callback priorities
remain supported. This includes the lifecycle changes from the original
PR.

- #9270: upgrades core dependencies and includes breaking API removals.
Actuators use `command_interface` / `command_interface_state` and
`drive`; Newton sensors use solver observables. Removed options include
`MujocoCollisionCfg.solmix`, `MJWarpSolverCfg.update_data_interval` /
`ls_parallel`, and `KaminoPADMMCfg.compl_tolerance`;
`soft_contact_margin` becomes `soft_contact_gap`. Native MuJoCo CPU
simulation requires one world. The temporary MJCF converter patch and
original migration documentation are included. ARM OptiX requires an
R590+ driver; #9369 retains the expected failure on current ARM CI.

## Type of change

- Release backport: bug fixes, dependency upgrades, compatibility
changes, CI updates, tests, and documentation.

## Validation

Latest combined head: `1a2304c75`. The branch includes a merge of
release tip `7cfe2659f` in `9f60679bc`; existing changes from that merge
are preserved.

### Final combined-head checks

- Full repository formatting/lint, changelog validation against
`upstream/release/3.1.0`, and `git diff --check upstream/release/3.1.0`
passed at `1a2304c75`.
- #9317 applied without conflicts and its stable patch ID matches the
original. Its required Newton revision
`838ddf544927333559af894dfba0edb1a9efba04` is already locked through
#9270.
- Focused MPM tests were attempted with `uv run --no-sync python -m
pytest source/isaaclab_newton/test/physics/test_newton_solvers.py -k mpm
-q`; collection is blocked by the missing `isaaclab_newton` installation
in this macOS environment. The CUDA regression requires
supported-platform CI.

### Earlier thirteen-backport checks

- Full repository formatting/lint passed:
`ISAACLAB_CHANGELOG_BASE_REF=upstream/release/3.1.0 uv run --no-sync
isaaclab --format`.
- Changelog validation against `upstream/release/3.1.0` and `git diff
--check upstream/release/3.1.0` passed.
- #9270 applied without conflicts and its stable patch ID matches the
original. Its original dependency lock, wheel overrides, runtime
adaptations, tests, golden image, and changelog fragments are preserved.
- Root dependency metadata: **13 passed**; wheel-builder metadata: **14
passed**, using `uv run --no-sync python -m pytest` on the corresponding
CLI test files.
- Reset-state buffers: **7 passed, 1 skipped** in the existing macOS
environment. This environment still has Warp **1.17.0**, so this result
does not validate the new Warp 1.20 runtime.
- Confirmed the lock selects Warp 1.20.0, MuJoCo/MuJoCo Warp 4.1.0,
Newton USD schemas 0.8.0, and Newton revision
`838ddf544927333559af894dfba0edb1a9efba04`.
- Updated dependency installation, GPU simulation/rendering, and a clean
docs build remain unvalidated locally. Earlier runtime test results
below predate #9270 and do not establish compatibility with the upgraded
dependencies.

### Earlier twelve-backport checks

- Full repository formatting/lint, changelog validation against
`upstream/release/3.1.0`, and `git diff --check upstream/release/3.1.0`
passed at `26293b3bc`.
- #9365 applied without conflicts and its stable patch ID matches the
original. It changes only the GR00T installation documentation;
`pyproject.toml` and `uv.lock` are unchanged by this cherry-pick.
- The updated installation command block passed `bash -n`. External
GR00T installation and training were not rerun locally.
- Clean docs validation remains outstanding on a supported platform, as
detailed below.

### Earlier eleven-backport checks

- Full repository formatting/lint, changelog validation against
`upstream/release/3.1.0`, and `git diff --check upstream/release/3.1.0`
passed at `2a7783ebe`.
- #9369 applied without conflicts and its stable patch ID matches the
original.
- Evaluated the actual OptiX xfail decorator for `aarch64`, `arm64`,
`x86_64`, and `AMD64`: only ARM64 enables `xfail(run=False)`; Newton
Warp tests retain no xfail marker.
- GPU rendering was not rerun locally.

### Earlier ten-backport checks

The following checks passed at `97dc765f9`, before the test-marker-only
#9369 cherry-pick:

- Full repository formatting/lint checks passed:
`ISAACLAB_CHANGELOG_BASE_REF=upstream/release/3.1.0 uv run --no-sync
isaaclab --format`.
- Changelog check passed: `uv run --no-sync python
tools/changelog/cli.py check upstream/release/3.1.0 --include-worktree`.
- `git diff --check upstream/release/3.1.0` passed.
- All ten stable patch IDs match their source commits.
- Tensor processors: **13 passed**, using `uv run --no-sync python -m
pytest source/isaaclab/test/utils/test_tensor_processors.py -q`.
- Direct CPU checks passed for scalar, batched, and empty requests in
uniform, triangular, and log-uniform sampling, plus integer-coefficient
digital-filter unit-delay behavior. The scalar-sampling and
integer-coefficient bugs were reproduced before these fixes were added.
- The existing uv interpreter and imported core package were verified to
point at this checkout.

### Earlier six-backport checks

The following passed at `2afdfd8be`, before the four additional
cherry-picks, using `uv run --no-sync python -m pytest <file> -q`, one
file per process:

- YAML I/O: **8 passed**.
- Clone-plan algebra: **32 passed, 5 skipped**.
- Ray-caster kernels: **17 passed**.

### Remaining validation

- Validation used the existing uv environment on macOS because normal uv
resolution rejects this platform; the committed lockfile supports Linux
and Windows only.
- A clean docs build was attempted for the initial six-backport head
with `uv run --no-sync isaaclab --docs`; its nested uv invocation was
blocked by that platform restriction. The expanded documentation changes
still need a supported-platform build.
- GPU/OVPhysX/Newton simulation integration, including the #9333
lifecycle changes, and cold-cache demos have not been rerun locally for
this combined backport.
- No complete CI result is claimed for the latest combined head.

## Checklist

- [x] Read the contribution guidelines.
- [x] Run full repository formatting and lint checks.
- [x] Preserve original documentation, tests, and package changelog
fragments.
- [x] Verify all fourteen cherry-picks match the original patches.
- [x] Run focused locally supported checks.
- [ ] Complete clean docs and GPU integration validation on supported
platforms.

---------

Signed-off-by: Sylvester Kaczmarek <[email protected]>
Co-authored-by: ooctipus <[email protected]>
Co-authored-by: YuTeh Shen <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Sylvester Kaczmarek <[email protected]>
Co-authored-by: hujc <[email protected]>
Co-authored-by: isaaclab-bot[bot] <282401363+isaaclab-bot[bot]@users.noreply.github.com>
Co-authored-by: fanes <[email protected]>
Co-authored-by: Richard Schmitt <[email protected]>
Co-authored-by: Mateo Guaman Castro <[email protected]>
Co-authored-by: Junnosuke Kamohara <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants