Skip to content

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

Closed
nblauch wants to merge 2 commits into
feat/isaaclab-fovi-sensorsfrom
feat/isaaclab-fovi-gaze-modes
Closed

nblauch wants to merge 2 commits into
feat/isaaclab-fovi-sensorsfrom
feat/isaaclab-fovi-gaze-modes

Conversation

@nblauch

@nblauch nblauch commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Description

Stacked on isaac-sim/IsaacLab#9074. This PR targets isaac-sim#9074's branch, so its diff shows only the gaze modes. It lives in this fork because an upstream PR can only target upstream branches; it will be opened against isaac-sim/IsaacLab:main once isaac-sim#9074 merges.

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 isaac-sim#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: 80 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 isaac-sim/IsaacLab#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

@nblauch
nblauch requested a review from ooctipus as a code owner November 20, 2026 00:34
@nblauch
nblauch force-pushed the feat/isaaclab-fovi-gaze-modes branch from f934e88 to 90b059a Compare November 20, 2026 01:10
@nblauch
nblauch added this pull request to stack #8 November 20, 2026 01:15
@nblauch
nblauch force-pushed the feat/isaaclab-fovi-gaze-modes branch from 90b059a to de44080 Compare November 20, 2026 03:12
@nblauch
nblauch force-pushed the feat/isaaclab-fovi-gaze-modes branch 3 times, most recently from bffd408 to 8a17795 Compare November 23, 2026 23:16
nblauch pushed a commit that referenced this pull request Nov 24, 2026
## Description

The Documentation Links job on isaac-sim#9070 fails because the G1 motion preview
was renamed from `g1_cr7.mp4` to `g1_jump_and_turn.mp4` on the
documentation asset host. [Hugging Face PR
#6](https://huggingface.co/datasets/nvidia/isaaclab-docs-assets/discussions/6)
confirms a 100% identical file rename.

Update the G1 motion-tracking guide and Command Builder to use the
renamed asset, preserving both video previews. The old reference is
already on `main`, introduced in isaac-sim#9098.

[Failing link-check
job](https://github.com/isaac-sim/IsaacLab/actions/runs/45206719337/job/137804323431)

## Type of change

- Documentation update

## Validation

- Renamed video URL: HTTP 200; old URL: HTTP 404.
- Lychee v0.24.2 on the updated motion-tracking guide: four links OK,
zero errors.
- `ISAACLAB_CHANGELOG_BASE_REF=upstream/main uv run --no-sync isaaclab
--format`: passed all hooks.
- `node --check docs/source/_static/css/environment-browser.js` and `git
diff --check`: passed.
- Clean Sphinx build attempted locally; blocked during API autosummary
imports by missing simulation dependencies in the minimal macOS
environment. Full documentation build remains for CI.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks with `isaaclab --format`
- [x] I have made corresponding changes to the documentation
- [x] I have validated the changed behavior with focused coverage
- No source package changes or test changes; no changelog fragment
required.
@nblauch
nblauch force-pushed the feat/isaaclab-fovi-gaze-modes branch from 8a17795 to bedc4e8 Compare November 24, 2026 00:49
nblauch and others added 2 commits November 23, 2026 19:25
isaac-sim#9074)

# Description

Adds `isaaclab_fovi`, a foveated camera for Isaac Lab built on the
[fovi](https://pypi.org/project/fovi/) library, active-gaze manager
terms, and an active-gaze Cartpole task. A foveated camera samples the
scene densely where it looks and sparsely in the periphery, on a
retina-like grid, instead of on a uniform pixel grid. The camera is an
experimental feature. Try it with `uv run --extra fovi isaaclab example
foveated-camera`.

**Camera** (`isaaclab_fovi.sensors`, depends only on `isaaclab`)

- `FoveatedCamera` / `FoveatedCameraCfg` work with the `newton_warp`,
`newton_optix`, `isaac_rtx` and `ovrtx` renderers. Newton casts one ray
per retinal sample; RTX and OVRTX render through a lens lookup texture.
- The retina places its samples by visual angle inside the field of view
of a physical camera: the one `spawn` describes (an ideal pinhole, or
the OpenCV model in `spawn.distortion`), or any calibrated camera given
as `camera_model`.
- The gaze turns the retina relative to the physical camera's optical
axis: `camera.set_gaze_angles(angles_deg)`. The gaze stays relative to
the mount when the mount moves, and `get_world_poses` reports the mount
on every renderer. `mask_to_sensor_fov` zeroes samples outside the
physical camera's image.
- `cmf_a_deg` sets the strength of foveation (default 0.591 deg, an
estimate from human data); a large value gives a matched non-foveated
baseline.
- With the default grid style the camera publishes an upright
`(num_envs, H, W, C)` image, as `ProxyArray` values like the core
`Camera`. Sample-set styles publish `(num_envs, N, 1, C)`; they are
experimental on RTX.
- Optional two-layer pooling (`pool_enabled`, `pool_mode`); segmentation
pools by modal label in its own dtype (`pool_int_mode="modal"`). With
`mask_to_sensor_fov`, pooling leaves out the photoreceptors the physical
camera does not see, so samples at the edge of its image are not
darkened.
- `set_intrinsic_matrices` leaves a foveated camera as configured and
warns, as the core camera does for OpenCV lens models.
- `FoveatedCameraCfg` rejects `tensor_processors` (such as PPISP) and
`isp_cfg`: they process pixel images, and a foveated camera publishes
retinal samples.

**Active gaze**

- `isaaclab_fovi.mdp`: `GazeActionCfg` (two bounded gaze actions, with a
fixed or tracked mount), `gaze_state`, and `gaze_teacher_labels`, a
teacher that labels the gaze action toward a point on an asset (never a
policy input). They run as Warp kernels with recorded launches.
- `IsaacContrib-Cartpole-Camera-Fovi` in
`isaaclab_tasks.contrib.active_gaze`: the stock Cartpole camera task
with a 32×32 foveated retina, two gaze actions and a teacher that looks
at the pole's tip, with the stock image and critic observations, CNN and
PPO settings. It is registered when the `fovi` extra is installed. Its
`GazeSupervisedPPO` adds a mean-only gaze supervision loss, and its
`GazeGaussianDistribution` head holds the gaze actions' noise at a fixed
0.1: the gaze step clamps its actions, so a learned gaze noise meets no
resistance and PPO's entropy bonus would grow it.

**Docs and example.** A concise Foveated Camera page under Experimental
Features, next to the visuo-tactile sensor: an overview figure of a
retina behind a 180° fisheye lens among sim-ready YCB and Isaac Lab
objects, path-traced with OVRTX (one fixation far to the side shows how
samples outside the lens render black), the sampling math, a
configuration example, and two interactive viewers
(`foveation-viewer.js`): one draws the sampling grid for a pinhole and a
fisheye camera as the style, CMF constant, resolution, field of view and
gaze change, the other shows which photoreceptors each pooled sample
averages. Their geometry matches fovi's `SamplingCoords` and
`GridPoolingLayer` exactly. The page documents the `foveated-camera`
example (`examples/sensors/foveated_camera.py`, `isaaclab example
foveated-camera`), which, like the tactile sensor's, is an example
rather than a demo. The Camera, Configure Rendering and installation
pages point to the page as experimental, and the troubleshooting import
table lists the extra; the task is in the environment browser, with API
pages for `isaaclab_fovi.mdp` and `isaaclab_fovi.sensors`. The docs
build passes with warnings as errors.

The example shows the retina in the Newton viewer through the stock
scene-camera view. It draws its viewing-sphere panel with the viewer's
stock `log_image` and reads its keys with `is_key_down`: I/J/K/L steer
the gaze and O/U magnify the panel's retina. The PR does not change
`isaaclab_visualizers`.

**Simplification.** #5 (by ooctipus, merged here) shares
the camera setup across the Newton and RTX backends, records the sensor
mask once per update and reuses it for every grid output (about 10%
faster masked publication with three outputs on an RTX 5090), declares
the Cartpole configs directly, and shortened the guide. It changes no
behaviour: the resolved Cartpole env and agent configs are identical,
and the RTX lens textures, grid outputs and teacher labels match byte
for byte.

**Dependencies.** A new optional extra, `fovi`, installs this package
and `fovi>=2.7` (MIT, PyPI), the only package it adds to the lock. fovi
2.7 moved its training-only packages into its own extras and replaced
pygeodesic with its own exact geodesic solver, which matches pygeodesic
to float64 rounding. fovi's other requirements are all already in Isaac
Lab's lock. The camera writes the RTX lens textures as float32 EXR files
itself, with NumPy and zlib, so it needs no image library. No core
runtime code changes. Outside the new package and the contrib task, the
PR touches the root `pyproject.toml` (the extra) and its extras test,
`uv.lock`, `docker/Dockerfile.base` and `.github/workflows/build.yaml`
(CI installs the extra and runs the package's tests), the docs, and
`isaaclab/programs.py` with the standalone-script cases in
`isaaclab/test/app/standalone_script_cases.py` (the example).

**Companion.** A draft IsaacLabTutorial PR adds an SO-101 vial-placement
task with active gaze that builds on this package.

## Type of change

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

## Validation

- The tests cover what `isaaclab_fovi` builds on Isaac Lab, so that a
later Isaac Lab change that breaks it fails here; fovi's own behaviour
is left to fovi's tests. 67 simulator-free test cases under
`source/isaaclab_fovi/test` (how the camera reads Isaac Lab's camera
configs, its gaze and mount handling and sensor mask, its rays, lens
textures and their EXR files, and published layout, its pooling of the
camera's buffers and segmentation, and the gaze manager terms) and 5
under `source/isaaclab_tasks/test/contrib/test_active_gaze_ppo.py`
(gaze-supervised PPO and the gaze head). Isaac Lab's kitless contrib
environment smoke test builds and steps
`IsaacContrib-Cartpole-Camera-Fovi`, and the standalone-script smoke
test launches the `foveated-camera` example.
- Render tests on Newton Warp, Newton OptiX and Isaac RTX (with Kit) and
on OVRTX (Kit-less), three per renderer, on one scene per renderer: the
distance seen at the retina's centre matches the analytic distance along
the gaze, from the first frame after a gaze change; the gaze stays
relative to a turned or moved mount; rendered distances follow each
foveated ray. All 12 pass, OptiX included, with NVIDIA driver
595.112.07.
- The example renders the same fixations on Newton + Warp, Isaac RTX and
OVRTX.
- fovi's software sampler, applied to a dense pinhole image of the same
scene, uses the same sample positions as the rendered retina and agrees
with it to 0.7/255 (Newton) and 2.8/255 (RTX) mean absolute RGB
difference. This checks sampling parity, so the same retina can be
computed from a real camera's images; it does not test sim-to-real
transfer.

### Testing burden

Measured on one RTX 6000 Ada with warm Warp caches, each test file in
its own process as CI runs them:

| Tests | Cases | Files | Time |
|---|---|---|---|
| Simulator-free (`isaaclab_fovi` and the contrib PPO test) | 72 | 8 |
35 s, mostly process start-up |
| Render, with Kit (Newton Warp, Newton OptiX, Isaac RTX) | 9 | 1 | 15 s
|
| Render, OVRTX without Kit | 3 | 1 | 12 s |

CI runs them in the existing job for `isaaclab_assets`,
`isaaclab_contrib`, `isaaclab_teleop`, `isaaclab_mimic` and
`isaaclab_experimental`. The Docker base image installs the `fovi`
extra, which adds `fovi`.

### Performance

Isaac Lab's runtime benchmark (random actions, no policy, so
environments reset as in training), Cartpole with 1024 environments,
1000 timed steps after 100 warmup steps, one RTX 6000 Ada, NVIDIA driver
580.178.04, at 81f8fb7 with its locked environment (Isaac Sim 6.2.0.0,
Newton 1.9.0.dev0, Warp 1.17.0, OVRTX 0.6.0, PyTorch 2.11.0+cu130, fovi
2.6.0). Step: mean `env.step` time ± its standard deviation. Memory:
peak rise of the GPU's used memory (`nvidia-smi`, every 0.5 s), covering
simulation and rendering but not training.

| Renderer | Stock (96×96) | Fovi, 96×96 | Fovi, 32×32 (the task's) |
|---|---|---|---|
| Newton + Warp | 2.55 ± 0.64 ms, 1.10 GiB | 3.03 ± 0.67 ms, 1.16 GiB |
1.76 ± 0.67 ms, 0.66 GiB |
| Newton + OVRTX | 18.11 ± 1.27 ms, 8.00 GiB | 22.11 ± 1.42 ms, 8.06 GiB
| 11.88 ± 1.39 ms, 5.36 GiB |

At the stock resolution the foveated camera costs about 0.5 ms (19%) on
Newton and 4 ms (22%) on OVRTX, part of which is OVRTX's per-frame cost
for a moving camera. Training 4096 foveated environments at 32×32 (8.0
GB) takes less memory than 512 stock environments at 96×96 (9.5 GB).

### Training

Cartpole, 200 iterations, stock PPO settings, on L40 nodes at f17a5c2;
final mean reward / success (fovi: gaze error to the pole tip). Runs are
in the W&B project `nvidia/isaaclab_fovi` (NVIDIA-internal).

| Physics + renderer | Stock, 96×96, 512 envs | Fovi, 32×32, 4096 envs |
|---|---|---|
| Newton + Warp | 4.96 / 1.00
([run](https://wandb.ai/nvidia/isaaclab_fovi/runs/e7i9dr9b)) | 4.91 /
0.99, 0.58° ([run](https://wandb.ai/nvidia/isaaclab_fovi/runs/eu4w1kyl))
|
| Newton + OVRTX | 4.92 / 0.98
([run](https://wandb.ai/nvidia/isaaclab_fovi/runs/nb8ml3lb)) | 4.66 /
1.00, 0.79° ([run](https://wandb.ai/nvidia/isaaclab_fovi/runs/heg5tm92))
|
| PhysX + Isaac RTX | 4.94 / 1.00
([run](https://wandb.ai/nvidia/isaaclab_fovi/runs/cple02ng)) | 4.93 /
1.00, 0.78° ([run](https://wandb.ai/nvidia/isaaclab_fovi/runs/cfnyq8bb))
|
| OVPhysX + OVRTX | 4.87 / 1.00
([run](https://wandb.ai/nvidia/isaaclab_fovi/runs/p56b20ux)) | 4.93 /
1.00, 0.63° ([run](https://wandb.ai/nvidia/isaaclab_fovi/runs/wg3ip1oo))
|

Fovi needs more iterations than stock because the policy also learns
where to look. After the move to contrib, a local 150-iteration run (512
environments, Newton + Warp) reaches a mean reward of 4.70 with a 0.49°
gaze error.

## Checklist

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

- [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
`uv run isaaclab --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/HEAD/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] 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)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: Octi Zhang <zhengyuz@nvidia.com>
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 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

Moved upstream as isaac-sim#9181, rebased onto main after isaac-sim#9074 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant