Skip to content

Add physical, hybrid and dual gaze to isaaclab_fovi - #9115

Closed
nblauch wants to merge 55 commits into
isaac-sim:mainfrom
nblauch:feat/isaaclab-fovi-gaze-modes
Closed

nblauch wants to merge 55 commits into
isaac-sim:mainfrom
nblauch:feat/isaaclab-fovi-gaze-modes

Conversation

@nblauch

@nblauch nblauch commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #9074. This branch starts from #9074's head, so until #9074 merges the diff here includes its commits. Only the last commit, f934e88e2, is new: compare against #9074's branch.

Adds physical, hybrid and dual gaze to isaaclab_fovi's gaze action, following FOVI-Dex, so a policy can turn a camera on a pan-tilt mount as well as the retina inside it. Until now the gaze action could only turn the retina inside a camera that does not move (software gaze).

Gaze modes (isaaclab_fovi.mdp)

GazeActionCfg.mode chooses what the gaze actions turn:

  • "software" (the default, unchanged): the retina, at once.
  • "physical": the joints of a rig that carries the camera. Each step adds to the joints' last targets, so a lagging head still reaches every command; the retina stays on the optical axis.
  • "hybrid": the retina at once, while the rig turns the camera after it. Each step the software gaze is aimed back at the fixation it holds in the world, and the head steps toward it by at most GazeRigCfg.max_step_deg. The policy sees a fast gaze, and the camera ends up pointing where it looks.
  • "dual" (experimental): four actions that move the rig's joints, as in physical gaze, and then the retina, as in software gaze, independently. The retina's actions come last, so the teacher and the Cartpole task's gaze loss steer it.

GazeRigCfg names the articulation and the two joints that turn the camera left and up. Every rig mode needs mount="tracked", so the Newton or OVRTX renderer. With a rig, gaze_state reports the head's angles plus the software gaze, so the observation means the same in every mode. One Warp kernel steps every rig mode.

Pan-tilt mount (isaaclab_fovi.assets)

PAN_TILT_CFG is FOVI-Dex's two-joint pan-tilt mount (a 5 KB USD with no visual geometry), and PAN_TILT_CAMERA_OFFSET places a camera on its tilting link. Its drives are about critically damped and settle in about 0.3 s; their armature carries the inertia, since the links alone are too light for a stable stiff drive at a 120 Hz physics step on MJWarp. The mount leaves gravity on: Newton reads one body's disable_gravity as the whole scene's. The repository ignores *.usda, so the file is force-added, as Isaac Lab's test USDs are; it could move to Nucleus instead.

Mount updates. FoveatedCamera.update_mount() reads the camera's pose and returns its mount. A lazily updated camera reads its pose only when its data is read, so without it hybrid gaze aimed from the mount of a step ago when nothing had read the camera yet, and the head never settled. The tracked-mount teacher from #9074 had the same one-step lag and now uses it too.

Docs. A "Gaze modes" section on the Foveated Camera page, with a config example and a figure of the four modes on the mount (below), plus API entries for GazeRigCfg and isaaclab_fovi.assets.

Gaze modes

Each mode on the pan-tilt mount, simulated with Newton's MJWarp solver at a 30 Hz policy step: the policy pans 4.5° left three times. In hybrid gaze the fixation jumps at once and holds while the head takes over from the retina; it leads the command by about 1° while the head moves, since the software gaze is aimed back once per step.

Next. A follow-up stacked PR will add a stereo vergence example with hybrid gaze.

Type of change

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

Validation

  • Simulator-free: 81 cases under source/isaaclab_fovi/test (3 new kernel steps, one per rig mode, and the new config checks in test_active_gaze.py), and the 5 contrib PPO cases.
  • One new Newton render case, test_hybrid_gaze_turns_the_head_onto_the_fixation, builds an environment with the mount and a foveated camera on it, pans three steps without reading the camera between steps, and checks three things: the retina leads the head, the head and the camera's world axis end on the commanded fixation with the retina back on the optical axis, and a reset restores the rig's default pose. It fails without update_mount. All render cases pass (the 3 OptiX cases skip here, as on Add isaaclab_fovi foveated camera sensors and active-gaze camera tasks #9074).
  • Rollouts of all four modes on Newton + Warp reach the commanded 13.5° (physical settles at 13.47°).
  • The docs build passes with warnings as errors.

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Add the isaaclab_fovi package with foveated camera sensors for the Newton and RTX renderers, their geometry helpers, tests and a render example. Register the package in the workspace and add the fovi extra.
Dense calibrated rendering is covered by the lens distortion support on the core camera spawn configuration. The stereo aperture geometry module had no callers.
Sort imports and modernize annotations under the root ruff configuration, and log a warning when a Kit sensor extension cannot be enabled instead of ignoring the failure.
FoveatedCamera is now the base class of the Newton and RTX implementations and returns the one matching the configured renderer. The configuration resolves the default renderer like CameraCfg does. Remove the gaze helper's pose getters, which shadowed Camera.get_world_poses with a different signature.
Replace the normalized cmf_a and cmf_a_frac fields with cmf_a_deg, passed to fovi unchanged together with the field of view in degrees for both field geometries. The RTX cortical disc layout now uses the field of view and CMF constant of the generated samples. Log the camera summary instead of printing it.
The foveated camera now defaults to spherical coordinates and the warped Cartesian grid style. The RTX texture layout follows from the style, so the ndc_layout field is removed, and unknown field geometries are rejected when the configuration is built.
Drop the projection and camera_fov_deg fields, the fixed-frustum gaze setters and their geometry module. Sensor masking is now one option, mask_to_sensor_fov, that uses the calibrated camera in spherical geometry. The cameras no longer modify the caller's configuration and accept an existing camera prim without spawn optics.
Add a package README covering installation, configuration, foveation strength, field geometry and gaze, and update the square-field guide for the current options.
Core Camera publishes ProxyArray values in camera.data.output. The foveated cameras published plain tensors for their grid and pooled buffers, so camera.data.output[name].torch failed.
Render ground distance on the Newton Warp and Isaac RTX renderers and compare the retina's centre with the analytic pinhole ray through the fixated pixel.
Install the fovi extra in the CI image and add the package to the combined package test job.
The hand-built scene had no body for Newton to attach the camera frame to, so the example failed on the Newton backend.
The retina always places its samples by visual angle inside the physical camera it looks through. The field_geometry option, the planar ray paths and their helpers are removed; log-polar styles go with them, because fovi does not support them in spherical coordinates.

Without camera_calibration, the physical camera is the one spawn creates: an ideal pinhole from PinholeCameraCfg optics, or the OpenCV model in spawn.distortion. An OpenCV fisheye with zero coefficients is an ideal equidistant fisheye. Gaze and edge masking now work for every camera.
…ra_model

Tasks drive the gaze through set_gaze_angles, (tilt, pan) in radians from the physical camera's optical axis; how a policy's actions map to those angles belongs to the task's action term. The image-position setter, the image-to-angle conversion and their compiled helpers had no callers outside tests and are removed.

camera_model holds fovi CameraModel fields, the same ones fovi's software sampler takes on a real camera. The gaze mixin is now VirtualGaze, and internal names drop the calibrated prefix.
Every other angle the foveated camera takes is in degrees: the CMF constant, the image rotation and the fields of view. set_gaze_angles now matches them.
The RTX camera writes the gaze into the camera prim on top of a mount orientation cached at startup, so moving the camera with set_world_poses was undone by the next gaze command. set_world_poses now refreshes the cached mount of the moved environments and re-applies their gaze. A render test moves one environment's camera after setting its gaze on both renderers.
Gaze actions change the gaze every step, after the camera has rendered. The test renders, turns the gaze and checks the retina's centre against the analytic ground distance on Newton and RTX.
isaaclab_fovi.mdp adds a gaze action in field radii with a radial limit, the gaze observation, a teacher's gaze labels toward a point on an asset, and an action penalty without the gaze. isaaclab_fovi.rsl_rl adds PPO whose loss also pulls the gaze means toward the teacher's.

Isaac-Cartpole-Camera-Fovi, Isaac-Lift-KukaAllegro-Camera-Fovi and Isaac-Reorient-KukaAllegro-Camera-Fovi are the stock camera tasks with the camera foveated at the same mount, optics and resolution. They keep the stock vision model and PPO settings, and are registered through the isaaclab.tasks entry point.
Seeing the pole needs little resolution: at 32 samples across, the policy trains as well as at the stock camera's 96 pixels, several times faster. The stock Cartpole camera task is unchanged.
Each frame recomputed the gaze pose, the sensor mask and the teacher's labels from dozens of small torch operations. One kernel now sets the gaze, one applies it to the camera pose, one masks the samples the physical camera does not see, and one computes the teacher's action, validity and fixation error. The projection mirrors fovi's CameraModel.project and is tested against it for pinhole, distorted pinhole and fisheye cameras.

On the 32-sample Cartpole task with 1024 environments, an environment step takes 1.8 ms instead of 3.3 ms.
Warp streams are cached per PyTorch stream, and Warp views of persistent buffers are wrapped once. The gaze action's step, limit, velocity and angles are one kernel, and the teacher's target point, labels and logged sums are another. The visible fraction is computed when read. Results are unchanged; the new kernels are tested against the torch code they replace.

On the 32-sample Cartpole task with 1024 environments, an environment step takes 1.5 ms instead of 1.8 ms.
The gaze action term declares itself graphable: it moves the gaze once per step in process_actions and does nothing in apply_actions, so Newton again records the other action terms and the decimation loop into its CUDA graph. The Newton camera masks rendered samples and lays them out in the upright grid with one kernel per output. The per-step Warp launches are recorded once and replayed, and the gaze observation is a buffer the gaze step writes. Results are unchanged; the new kernels are tested against the code they replace.

On the 32-sample Cartpole task with 1024 environments, an environment step takes 1.14 ms instead of 1.48 ms, against 0.93 ms for the stock camera task.
The gaze step writes the camera's own angles buffer and reads the action manager's buffer, so a step needs no copy or set launch; the Newton pose kernel turns the gaze from the stored angles. The camera hands the renderer its pose once per update instead of twice. A gaze reset is one recorded kernel instead of thirteen torch ops, and the camera's reset pose update replays a recorded launch. The teacher's labels and logs come from one single-block kernel, without zeroed atomics.
…rnel

OVRTX renders the poses the camera hands it, so the foveated RTX camera on OVRTX turns the gaze in the pose kernel, as on Newton, instead of writing prim poses on every gaze change (about 0.5 ms each). Isaac RTX keeps the prim writes that Replicator reads. Native-grid RTX frames go through the same fused publish kernel as Newton's, which moves from the Newton camera into VirtualGaze. The render cases move into a shared module so OVRTX runs them without Kit, which cannot load beside it.
Fix the sensor mask for rolled mounts (it now checks the rendered rays through the mount roll), publish only the environments a frame updated, keep the Isaac RTX mount when set_world_poses moves only the position or set_world_poses_from_view turns it, read OVRTX's near clip from the camera prim without a spawn configuration, reject async OVRTX with the sensor mask, release the lens-texture directory, report the published image shape, and let oracle_loss_coef=0 train plain PPO without teacher labels.

Add a tracked gaze mount: the pose kernel records each camera's mount, and the teacher follows it, for software gaze on a moving head; a fixed mount stays the default and raises if the mount moves. Pooled segmentation takes each sample's modal label in its native dtype.

Merge the virtual gaze into FoveatedCamera with the shared accessors and sensor mask, build Newton's ray array in the Newton camera, validate tiles before allocating, keep gaze and velocity as views of one state buffer, drop the unused single-point teacher, use stub-backed lazy exports, and tighten docs and tests (first frame after a gaze change, independent grid and lens-inverse oracles, trimmed parameter products, kitless markers).
The fovi extra installs OpenEXR, so the OpenCV fallback and its process-wide setting go; a missing OpenEXR now raises its own import error. The pose test keeps each selection path and autocast once instead of crossing batch sizes.
The camera already authors OmniLensDistortionLutAPI lookup-table lenses; the module and its functions kept names from the legacy generalized-projection API. generalized_projection becomes lens_lut, with build_lut_textures, save_lut_textures and apply_lens_lut_to_prim.
The module carried a proprietary NVIDIA notice from its source project alongside the package's BSD-3-Clause header; the package is BSD-3-Clause.
Cameras: Newton and OVRTX reject update_latest_camera_pose=False, under which the renderer would never see the gaze; the mount record starts at the current ungazed pose; Isaac RTX reads its pose as the mount until a gaze is written; each OVRTX camera adds its own near clip; sample-set exit LUTs mark out-of-field rays invalid instead of sending them to the fovea; Newton sample sets publish their own buffers so a partial update changes only the updated rows; Newton reuses the gaze geometry's rendered rays.

Gaze: the teacher's labels, logs and launch live in gaze_teacher_labels; GazeAction exposes teacher_mounts(); entity_point, direction_to_angles and clamp_gaze are gone; the gaze width is fixed at two actions (GAZE_ACTIONS) for the head and the loss; slice resets build only the selected indices.

Small: pool_mode lists its modes, render_foveated.py takes --cmf_a_deg, lens_lut drops its banners, an explicit foveated_res is kept.

Tests: the repository's device selection replaces hard-coded CUDA devices; new tests for the mount record, the pose-update guard, sample-set publication, per-camera near clips and the invalid exit texels.
- Isaac RTX reports the mount, without the gaze, from get_world_poses, so a
  get-then-set round trip keeps the mount and the gaze.
- Foveated cameras skip set_intrinsic_matrices with a warning: the retina
  sets their rays, which the renderer would otherwise replace.
- Pooled integer outputs are rounded to the nearest value, not truncated.
- Pooled rgb is the view of pooled rgba whenever the renderer publishes
  rgb, so an rgba-only pooled sample set no longer publishes zero rgb.
- On Newton, the sensor mask and its visibility record change only for the
  updated environments, matching the frames the camera publishes.
- Segmentation pools by modal label (pool_int_mode="modal", the only
  accepted value); pool_mode accepts only fovi's modes.
- Document that sample-set styles are experimental on RTX.
- Update the tests to the camera's real pose buffers and the teacher kernel
  without rotate_offset, and remove the remaining banners.
- Add API reference pages for isaaclab_fovi.mdp, .rsl_rl and .sensors.

- Port render_foveated.py to launch_simulation; its scene types are imported once Kit has started, as Kit must provide USD support first.

- Remove the compare_outputs.py example.

- Check the aggregate wheel's fovi task entry point directly, and test that conflicting entry points stop the wheel generator.
- Count a mount turn only when set_world_poses changes a selected camera's mount, so writing back the reported pose leaves the fixed-mount teacher valid.

- Warn callers of set_intrinsic_matrices with a UserWarning.

- Read near clips only for OVRTX distance_to_camera output.

- Point fov_type and radius_norm to fovi's documentation instead of a square-coverage page; the fixed-mount docs say the teacher raises.

- Follow the module member order, type the RTX texture buffers as ProxyArray, and trim stale comments.

- Build the pooling tests from FoveatedCameraCfg and remove tests that only exercised test helpers or replayed other tests.
- Count a mount turn by comparing each selected mount before and after any pose write, so repeating a view or writing back a pose leaves the fixed-mount teacher valid; Isaac RTX writes its gaze back onto moved prims through one hook.

- Resolve gaze pose index selectors (sequences, slices, tensors, int64 or strided Warp arrays) to contiguous int32 indices.

- Publish partial updates with the stock masked copy instead of full-batch torch.where temporaries.

- Place every sample-set direction texel by UV, build the high-resolution grid from the low-resolution one, import fovi at module scope in pooling, and check spawn configurations by type.

- Add the fovi extra to the opt-in extras of the pyproject test.

- Test that pooled rgb is a view of pooled rgba, and document how the sensor mask meets pooling.
- ungazed_quat_w_ros reads an Isaac RTX camera's mount through get_world_poses once a gaze is in its prims, so a fixed-mount gaze action created after a gaze captures the real mount instead of raising.

- motor_action_l2 reduces only the actions before the gaze, and requires the gaze to be the last action term.
…ent the camera

- isaaclab_fovi now holds only the sensors and the gaze manager terms and depends only on isaaclab.

- The active-gaze Cartpole task, its gaze-supervised PPO and its gaze action head move to isaaclab_tasks.contrib.active_gaze as IsaacContrib-Cartpole-Camera-Fovi, registered when the fovi extra is installed. The other active-gaze tasks and motor_action_l2 are removed.

- Without an entry point, the wheel builder change and its test are reverted.

- The render example becomes the foveated-camera demo.

- Document the foveated camera: a sensor concept page, a rendering section, the demo, the fovi extra in the install and troubleshooting tables, and the task in the environment browser; the package README points to them.
With mask_to_sensor_fov, the mask zeroed the photoreceptors outside the physical camera's image and pooling then averaged those zeros in, darkening pooled samples at the image edge. Pooling now leaves them out: averaging modes divide by the pooled visibility, max ignores them, and they do not vote in modal segmentation pooling. A pooled sample that sees no photoreceptor is zero.

The pool_mode docstring now says sum applies only to sample-set styles, as grid pooling rejects it.
- The sampling math from FOVI-Dex: the CMF, the warped Cartesian lattice, the rays and their sample spacing.

- Figures rendered from the demo scene: the retina on the viewing sphere and the published image at two fixations, the renderers, foveation strength, the sensor mask, pooling, and the Cartpole task's gaze following the pole.

- An interactive sampling viewer for an equidistant fisheye and a pinhole camera, each with its own field of view, as the style, CMF constant, resolution and gaze change.

- An interactive pooling viewer showing which photoreceptors each sample pools, with grid windows or, for isotropic retinas, fovi's own KNN neighbourhoods.

The viewers' geometry matches fovi's SamplingCoords, the camera's gaze rotation and GridPoolingLayer.
Keep the tests that guard isaaclab_fovi's own behaviour against changes in Isaac Lab: how it reads Isaac Lab's camera configs, its gaze and mount handling, its rays, lens textures and published layout, its pooling of the camera's buffers and segmentation, its gaze manager terms, and the renders on each backend. fovi's own behaviour, such as each pooling mode's arithmetic and its exclusion of invalid photoreceptors, is left to fovi's tests.

- Drop CPU copies of tests whose kernels and Python paths are the same on every device, and parameter values that take the same branch.

- Merge the square-shell grid tests into the native-grid tests, the gaze kernels into the camera's gaze tests (now test_camera_gaze.py), the renderer dispatch and import boundary into the config tests, the lens textures and schema into the RTX camera tests, and Newton's ray array into the Newton buffer tests. The import check's helper script moves inline.

- Render tests share renders: gaze following and gaze change in one, both kinds of mount move in one, and the density check renders once, comparing against an even grid's rays computed directly.

Simulator-free: 200 cases in 15 files (79.7 s with one process per file) become 83 in 8 (49.1 s). Render: 6 cases and 7 renders per backend become 3 cases and 3 renders, 61.6 s to 44.3 s here with OptiX skipped.
Every FoveatedCameraCfg and GazeActionCfg field now has a one-line docstring, and the class points to the Foveated Camera page. The page gains what the docstrings carried and it lacked: the retinal window settings, the mount roll, the isotropic cortical layout, the RTX exit texture size, fractional pool_res_mult for sample sets, and the neighbour-distance options.
GazeActionCfg.mode chooses what the gaze actions turn: the retina
(software, the default), the joints of a rig that carries the camera
(physical), the retina at once while the rig follows and takes over
(hybrid), or both independently with four actions (dual, experimental).
GazeRigCfg names the rig's articulation and joints; every rig mode needs
a tracked mount.

One Warp kernel steps every mode. Physical and dual steps add to the last
joint targets, so a lagging head still reaches each command. Hybrid aims
the software gaze back at the fixation it holds in the world each step,
and steps the head toward it by at most max_step_deg.

FoveatedCamera.update_mount reads the camera's pose before a lazily
updated camera renders. Hybrid gaze and the tracked-mount teacher aim
from it, so they no longer use a mount a step old when nothing has read
the camera's image yet.

isaaclab_fovi.assets adds PAN_TILT_CFG, a two-joint pan-tilt mount with
about critically damped drives that is stable on MJWarp at 120 Hz. It
leaves gravity on, since Newton reads one body's disable-gravity flag as
the whole scene's.

The Foveated Camera page gains a Gaze modes section, with a figure of
the four modes on the mount. The tests cover each mode's kernel step and
config checks, and one Newton case drives hybrid gaze through an
environment without reading the camera between steps.
@nblauch
nblauch requested a review from a team November 20, 2026 00:24
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team infrastructure labels Nov 20, 2026
@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[Medium impact] The PR adds an optional camera feature and a task that use it.

Fix the rig observation timing and hybrid teacher labels before merging.

Findings

  1. P1 Rig observations lag behind physics ▶
  2. P1 Hybrid teacher corrects twice ▶

Summary

Adds foveated cameras, active-gaze training, and camera rigs with physical, hybrid, and dual gaze.

  • Foveated cameras render detailed images around a movable gaze.
  • Gaze actions can turn the retina, a camera rig, or both.
  • The Cartpole camera task trains gaze with teacher labels.
  • The demo and optional fovi install make foveated cameras easier to try.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Policy actions] --> M{Gaze mode}
    M -->|Software| S[Move retina]
    M -->|Physical| P[Move joint targets]
    M -->|Hybrid| H[Hold world direction and follow with head]
    M -->|Dual| D[Move joints and retina independently]
    H --> P
    H --> S
    D --> P
    D --> S
    P --> F[Physics moves camera mount]
    F --> C[Foveated camera]
    S --> C
    C --> O[Policy image]
    C --> T[Teacher gaze labels]
Loading

Reviews (1) · Last reviewed commit: "Add physical, hybrid and dual gaze to th..." · Reviewed by Greptile

Comment on lines +270 to +273
gaze = head + soft
previous = wp.vec2f(state[i][0], state[i][1])
rate = (gaze - previous) / step_dt
state[i] = wp.vec4f(gaze[0], gaze[1], rate[0], rate[1])

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 Rig observations lag behind physics. The rig's measured angles and velocity are saved during process_actions, before the head moves. After physics advances, gaze_state returns that unchanged buffer. In physical mode, the first returned observation therefore still reports the starting gaze and zero velocity even though the camera has turned. Hybrid and dual observations also pair the previous head pose with the new software gaze.

Refresh the measured head contribution after physics, before returning the observation, and compute velocity from consecutive observed states.

Knowledge Base Used: Simulation, rendering, and sensors

Comment on lines +108 to +109
gaze = angles_deg[i] / field_radius_deg
result = teach(point, positions[i], mounts[i], gaze, frame, field_radius_deg, step_size, gaze_limit, camera)

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 Hybrid teacher corrects twice. The teacher subtracts the stored software gaze from a target measured against the head's current pose. Hybrid mode already corrects for that head movement on the next action, before adding the teacher's step.

For example, with a held target 4.5° left, a 1° head turn leaves the stored software gaze at 4.5° but puts the target 3.5° from the current mount. The teacher requests −1°. Hybrid mode first restores the gaze to 3.5°, then applies that extra −1°, moving the held fixation off the target. Compute hybrid labels against the same re-aimed gaze that the next action uses.

@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: Design and architecture (3), Scope and over-engineering (3), Implementation (5), Style consistency (11), Test quality (5). Other reviewed categories look good.

  • PR description: Separate inherited validation, narrow reset claims to asserted state, and benchmark policy-step cost against #9074 with revisions, command, hardware, backend, environment count, warmup, and latency; preserve template sections.
  • Design and architecture: Physical teacher labels ignore accumulated joint targets, so repeated feedback drives a lagging head past fixation; compute physical labels from those targets.
  • Scope and over-engineering: Minimal implementation: Extend Camera, GazeAction, and Cartpole; keep all added sensor modules, gaze/config modules, pan_tilt, exports, demo, render cases, and remaining training modules for their contracts; merge active_gaze_cfg into Cartpole, delete its reflective preset chain, singleton pool_int_mode, and runtime rig-mode dispatch. Suggested PR breakdown: (1) sensors/demo/docs, validated by camera contracts; (2) Cartpole/PPO, validated by training contracts; (3) rig/asset/mount refresh, validated by physical settling.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Rig state samples joints before physics, pairing stale head angles with the next image; refresh measured gaze at the observation boundary after physics.
  • Style consistency: The assets export eagerly imports its implementation, violating the required package pattern; use lazy_export() with explicit names in an adjacent stub.
  • Test quality: Several added assertions accept broken behavior or use fixture-supplied results; replace those oracles with independent expectations and consolidate repeated ground-scene lifecycles while preserving distinct contracts.

Significant concerns. Posted 27 inline findings.

Automated review; human maintainers own approval decisions.

i = lane
while i < count:
point = targets[i] + wp.quat_rotate(orientations[i], offset)
gaze = angles_deg[i] / field_radius_deg

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.

🔴 Critical · Design Architecture — Teacher ignores physical joint targets

Physical actions accumulate joint targets, but the teacher subtracts only software gaze from the desired direction. A lagging head receives repeated commands past the target. Base physical-mode labels on controlled joint targets.

targets[i, 0] = wp.clamp(pan_base + signs[0] * turn[1] * radius_rad, pan_limit[0], pan_limit[1])
targets[i, 1] = wp.clamp(tilt_base + signs[1] * turn[0] * radius_rad, tilt_limit[0], tilt_limit[1])
angles_deg[i] = soft * field_radius_deg
gaze = head + soft

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.

🔴 Critical · Design Architecture — Compose rig and retinal rotations

Adding joint and software angles is not rotation composition when both axes turn. Dual and hybrid gaze_state can report a fixation different from the rendered one. Derive state from the composed direction.

data = self.rig.data
# Reading the properties refreshes the rig's joint buffers. Hybrid gaze aims from the mount as the head stands
# now, which a lazily updated camera has not read yet.
joint_pos, limits = data.joint_pos.warp, data.soft_joint_pos_limits.warp

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.

🔴 Critical · Implementation — Refresh rig observation after physics

State records measured joints during action processing, before targets are applied and physics advances. The next observation pairs the previous head pose with the current image. Refresh measured gaze after physics.

Comment thread docs/conf.py
sys.path.insert(0, os.path.abspath("../source/isaaclab_ov/isaaclab_ov"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_visualizers"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_visualizers/isaaclab_visualizers"))
# Only the package root: the package's ``rsl_rl`` subpackage would shadow RSL-RL as a top-level module.

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 — Remove nonexistent shadowing rationale

The comment attributes this path choice to an isaaclab_fovi.rsl_rl subpackage, which the added package does not contain. Remove the false explanation.

is a valid target. It is a training label, never a policy input.

The ``IsaacContrib-Cartpole-Camera-Fovi`` task in :mod:`isaaclab_tasks.contrib.active_gaze` puts them together. It is
the stock Cartpole camera task with the camera foveated (a 32-sample retina), two gaze actions, and a teacher that looks

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 — State the actual retina resolution

RETINA_RES is the side of a 32 × 32 grid, not a 32-sample retina. Correct the task description to match its configuration and figure.

The rendered distances match the ground along each sample's ray well off the centre, and not along the rays of an
even grid with the same resolution and field of view, so a renderer that traced an even grid instead fails.
"""
distance, field, angles, fov = _render(backend, torch.zeros(1, 2))

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 — Reuse the ground-scene render

The density case rebuilds the same scene and zero-gaze frame used by follows_gaze for each backend. Assert both contracts within one scene lifecycle, retaining the distinct calibration inputs.

source = quat_from_matrix(matrix_from_quat(source_gl.double()) @ conversion.T).float()
original = source.clone()
angles = torch.tensor([[7.5, -12.0]], device=device).repeat(batch_size, 1)
angles[1::2] = 0

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 — Give unselected rows nonzero gaze

Unselected cameras have zero gaze, so applying gaze to every row can still satisfy the preservation assertions. Give unselected rows nonzero gaze.

monkeypatch.setattr(newton_camera, "build_lowres_coords", lambda *args, **kwargs: (coords, 16))
monkeypatch.setattr(newton_camera, "build_highres_coords", lambda *args, **kwargs: highres)
monkeypatch.setattr(newton_camera, "build_pooler", lambda *args, **kwargs: (pooler, 4))
monkeypatch.setattr(FoveatedNewtonCamera, "_initialize_gaze", rendered_rays_only)

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 fixture-supplied ray oracle

rendered_rays_only supplies native_grid_directions, which the ray assertion calls again. Broken production gaze geometry passes. Use the real initializer and independent expected directions.

invalid = (texels == -1.0).all(dim=-1)
# Rays outside the 10 degree field outnumber those inside it on the hemisphere's octahedral grid.
assert invalid.float().mean() > 0.5 and (~invalid).any()
assert all(any(torch.equal(texel, sample) for sample in uv) for texel in texels[~invalid])

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 — Assert nearest-sample mapping

Membership accepts mapping every valid inverse-LUT ray to the fovea, despite the test's nearest-sample claim. Assert independently known off-axis rays map to their noncentral samples.

return FoveatedCameraCfg(**values, foveated_res=resolution, mask_to_sensor_fov=True)


def foveated_presets(cameras: PresetCfg, foveated_res: int | None = None) -> PresetCfg:

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 · Scope Complexity — Keep preset selection in Cartpole

Only Cartpole uses this reflective convert-every-preset-then-filter chain. Declare its RGB and depth foveated camera alternatives in cartpole_camera_fovi_env_cfg.py and delete the chain.

@nblauch

nblauch commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Closing: this is stacked on #9074, and an upstream PR can't target #9074's branch, so its diff here included all of #9074. Review it as a stacked PR in the fork instead, where it shows only the gaze modes: nblauch#6. It will be reopened against main once #9074 merges.

@nblauch nblauch closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant