Skip to content

Add binocular gaze with version and vergence, and a stereo example - #7

Closed
nblauch wants to merge 1 commit into
feat/isaaclab-fovi-gaze-modesfrom
feat/isaaclab-fovi-stereo-vergence
Closed

nblauch wants to merge 1 commit into
feat/isaaclab-fovi-gaze-modesfrom
feat/isaaclab-fovi-stereo-vergence

Conversation

@nblauch

@nblauch nblauch commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Description

Stacked on #6 (gaze modes), which is stacked on isaac-sim/IsaacLab#9074. This PR targets the gaze-modes branch, so its diff shows only this step. It will be opened against isaac-sim/IsaacLab:main once the PRs below it merge.

Adds binocular gaze to isaaclab_fovi, after FOVI-Dex's stereo head: two foveated eyes on one body fixate a point together, with hybrid gaze turning the head after them. A foveated-stereo example shows it.

Binocular gaze (isaaclab_fovi.mdp)

  • BinocularGazeActionCfg moves both eyes with three actions: the version, their shared line of sight (tilt, pan), and the vergence, the angle between their lines of sight. Each eye turns from the version by half the vergence, toward the other eye, in the plane that holds the version and the baseline, so the two lines of sight always meet; the farther the fixation, the smaller the vergence.
  • The version moves as a single camera's gaze does in "software", "physical" or "hybrid" gaze (Add physical, hybrid and dual gaze to isaaclab_fovi #6); the vergence always turns the retinas. Both are in field radii, and the vergence stays between zero (parallel) and vergence_limit.
  • binocular_gaze_state observes the version, the vergence and their velocities.
  • binocular_gaze_teacher_labels labels the actions that fixate a point with both eyes: the version bisects the eyes' lines of sight to it and the vergence is their angle. The decomposition is exact, since the two lines of sight are symmetric about their bisector.
  • The eyes need parallel optical axes, the same retina, and a renderer that turns their poses by the gaze (Newton or OVRTX). One Warp kernel steps every mode.

Stereo head (isaaclab_fovi.assets). PAN_TILT_STEREO_OFFSETS places two eyes 6.5 cm apart on the pan-tilt mount's tilting link.

Example. isaaclab example foveated-stereo steps both eyes with the teacher's labels between four objects 0.4 m to 3.6 m away, in hybrid gaze on MJWarp. The viewer shows the left eye; its camera menu switches to the right eye or an overview. Headless, both lines of sight end within 1 mm of every object, and the vergence follows the distance, from 1° at 3.6 m to 10° at 0.4 m.

Docs. A "Binocular gaze" section on the Foveated Camera page, with a figure of the example (below), and API entries. Like the foveated camera's, the example lives in examples/sensors and is documented on the experimental page, not the Demos page.

Binocular gaze

Top: both eyes' 128 × 128 images at the end of each fixation. The fixated object sits in both foveas, while nearer or farther objects fall in different places in the two eyes. Below: the version jumps to each object while the head turns after it, and the vergence follows the object's distance. Hybrid gaze holds the version's direction rather than a point, and turning the head moves the eyes, so for near objects the teacher keeps adjusting the version and vergence while the head turns.

Script cases. The foveated-stereo example is declared in Isaac Lab's standalone-script cases with its fixed MJWarp physics and the Newton viewer. isaac-sim#9074 does the same for foveated-camera.

Type of change

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

Validation

  • Simulator-free: 84 cases under source/isaaclab_fovi/test, 4 of them new. They check that the lines of sight stay in one plane with the baseline off the optical axis and meet at the vergence's angle, the vergence's limits, hybrid version with the head following, the teacher's labels for a point ahead and one behind, and the config checks.
  • One new Newton render case, test_binocular_gaze_fixates_a_near_point_with_both_eyes, steps the stereo head with the teacher's labels toward a point 0.4 m away and 15° to the left. It checks that both eyes' optical axes pass within 1 mm of the point, that the head carries the version and the vergence matches the point's distance, and that a reset restores parallel lines of sight. Flipping the vergence's direction in the kernel fails it and the vergence unit test. 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).
  • The standalone-script smoke test launches both foveated examples through the isaaclab CLI.
  • 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 01:08
@nblauch
nblauch force-pushed the feat/isaaclab-fovi-stereo-vergence branch from 350556e to d03a355 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-stereo-vergence branch from d03a355 to 5cb9d26 Compare November 20, 2026 03:12
@nblauch
nblauch force-pushed the feat/isaaclab-fovi-stereo-vergence branch 2 times, most recently from 74f58a8 to 668b28b Compare November 23, 2026 22:27
@nblauch
nblauch force-pushed the feat/isaaclab-fovi-stereo-vergence branch from 668b28b to db82af1 Compare November 23, 2026 23:16
@nblauch nblauch changed the title Add binocular gaze with version and vergence, and a stereo demo Add binocular gaze with version and vergence, and a stereo example Nov 23, 2026
@nblauch
nblauch force-pushed the feat/isaaclab-fovi-stereo-vergence branch from db82af1 to 1a840c1 Compare November 24, 2026 00:49
BinocularGazeActionCfg moves two foveated cameras on one body with three
actions, as fovi-dex's stereo head does: the version, their shared line
of sight (tilt, pan), and the vergence, the angle between their lines of
sight. Each eye turns from the version by half the vergence toward the
other, in the plane of the version and the baseline, so the lines of
sight always meet. The version moves as a single camera's gaze does in
software, physical or hybrid gaze; the vergence always turns the retinas.
One Warp kernel steps every mode.

binocular_gaze_state observes the version, the vergence and their
velocities. binocular_gaze_teacher_labels labels the actions that fixate
a point with both eyes: the version bisects the eyes' lines of sight to
it and the vergence is their angle, an exact decomposition.

PAN_TILT_STEREO_OFFSETS places two eyes 6.5 cm apart on the pan-tilt
mount's tilting link. The foveated-stereo example (isaaclab example
foveated-stereo) steps them with the teacher's labels between objects
from 0.4 m to 3.6 m, in hybrid gaze on MJWarp; both lines of sight end
within a millimetre of each object.

The experimental Foveated Camera page gains a Binocular gaze section
with a figure of the example. The tests cover the vergence geometry,
hybrid version, the teacher and the config checks, and one Newton case
fixates a near point with both eyes through an environment.
@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

Moved upstream as isaac-sim#9183 (stacked on isaac-sim#9181), rebased onto main after isaac-sim#9074 merged.

@nblauch nblauch closed this Nov 24, 2026
kellyguo11 pushed a commit to isaac-sim/IsaacLab that referenced this pull request Dec 3, 2026
# Description

Follows #9074, which added `isaaclab_fovi`. This PR
now carries all of the active-gaze work: it includes
#9181 (gaze modes, now a draft), which was reviewed on
its own, and adds binocular gaze on top. Both were first reviewed in the
fork, as nblauch#6 and nblauch#7.

Following [FOVI-Dex](https://fovi-dex.github.io/), it lets a policy turn
a camera on a pan-tilt mount as well as the retina inside it, and fixate
a point with two foveated eyes on one head. Until now the gaze action
could only turn one camera's retina (software gaze). The
`foveated-camera` example's new `--stereo` mode shows binocular gaze.

**Fixes to `main`.** Three changes fix bugs in `gaze_teacher_labels`
from #9074, listed under Fixed in the changelog: it
rendered a frame for every label (see *Teacher pose reads*), a tracked
mount's teacher aimed from the mount of the step before (see *Mount
updates*), and a target naming the asset's only body raised a
`TypeError`, since Isaac Lab resolves body ids that cover every body to
a slice.

## Gaze modes (`isaaclab_fovi.mdp`)

`GazeActionCfg.mode` chooses what the gaze actions turn:

- `"software"` (the default, unchanged): the retina.
- `"physical"`: the rig's joints; each step adds to their last targets,
so a lagging head still reaches every command.
- `"hybrid"`: the retina at once, while the rig turns the camera after
it by at most `GazeRigCfg.max_step_deg` per step and the fixation holds
in the world.
- `"dual"` (experimental): four actions, the joints as in physical gaze
and then the retina, independently.

The `GazeAction` docstring and the Foveated Camera page describe each
mode in full. `GazeRigCfg` names the articulation and its pan and tilt
joints. The rig modes need `mount="tracked"` and a camera without image
roll. With a rig, `gaze_state` reports the fixation's direction from the
rig's zero pose, the head's turn composed with the retina's, so the
observation means the same in every mode. In physical gaze the retina
stays where the gaze action leaves it, on the optical axis, unless
something sets it directly with `FoveatedCamera.set_gaze_angles`; in
hybrid gaze such a call starts a new fixation, which
`FoveatedCamera.gaze_writes` lets the action tell apart from its own
writes.

`gaze_teacher_labels` labels from where the next step starts: in hybrid
gaze the software gaze re-aimed at its held fixation, and in physical
gaze the head's commanded pose, so it never repeats a turn the head has
made or has yet to make. Its target body may also be named when it is
the asset's only body.

- *Teacher targets in the world.* `gaze_teacher_labels` takes
`target_w`, a function of the environment that returns each
environment's target point, as an alternative to `target_cfg`. A target
chosen per environment, such as the object a command picks among
several, is not a point fixed to one asset.
- *Teacher pose reads.* The teacher took the camera's position from
`camera.data`, and reading a camera's data updates its image, so
labelling rendered a frame; a policy that observes every fourth control
step and labels every step rendered four frames for each one it used.
The teacher now reads the new `FoveatedCamera.mount_pos_w`, which
`update_mount` refreshes.

**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 and the head never settled. The tracked-mount teacher from
#9074 had the same one-step lag and now uses it too.

**Tracked mounts on Isaac RTX.** A tracked mount needed a renderer that
turns the camera's pose by the gaze, so the rig modes ran only on Newton
and OVRTX. An Isaac RTX camera holds its gaze in its prim, relative to
the prim's parent, so it already follows a moving mount; only the
recorded mount was missing. `update_mount` now reads it back from the
prim, without the gaze, and `mount="tracked"` works with every renderer.

## Binocular gaze (`isaaclab_fovi.mdp`)

- `BinocularGazeActionCfg` moves two eyes with three actions: the
**version**, their shared line of sight (tilt, pan), and the
**vergence**, the angle between their lines of sight. Each eye turns
from the version by half the vergence, toward the other eye, in the
plane that holds the version and the baseline, so the two lines of sight
always meet; the farther the fixation, the smaller the vergence.
- The version moves as a single camera's gaze does in `"software"`,
`"physical"` or `"hybrid"` gaze; the vergence always turns the retinas.
Both are in field radii, and the vergence stays between zero (parallel)
and `vergence_limit`.
- `binocular_gaze_state` observes the version, the vergence and their
velocities; with a rig, the version is its direction from the rig's zero
pose, as for `gaze_state`.
- `binocular_gaze_teacher_labels` labels the actions that fixate a point
with both eyes: the version bisects the eyes' lines of sight to it and
the vergence is their angle. The decomposition is exact, since the two
lines of sight are symmetric about their bisector. Like
`gaze_teacher_labels`, it starts from where the next step does, takes
`target_w`, reads both eyes' positions from `mount_pos_w` without
rendering, and checks each eye's visibility with its own camera.
- `binocular_gaze_angles` turns a version, a vergence and the baseline
between the eyes into each eye's gaze without an action term, through
the same Warp function as the action's step, so code outside a
manager-based environment can drive two foveated cameras with the same
geometry.
- The eyes need one body to carry them (their prims share a parent),
parallel optical axes, and the same retina, on any renderer: Newton,
OVRTX or Isaac RTX. The rig modes also need eyes without image roll.
- The gaze actions write the rig's joint targets with a persistent
joint-id array. A list became a new device array on every write, and
with cameras rendering, a captured Newton physics step faulted on that
freed memory.

Each gaze mode has its own Warp kernel, only hybrid gaze allocates the
fixation it holds, and a Warp kernel resets the reset environments.

## Pan-tilt mount (`isaaclab_fovi.assets`)

`PAN_TILT_CFG` is FOVI-Dex's two-joint pan-tilt mount, with no visual
geometry. `spawn_pan_tilt` builds it in the stage, its three links and
its fixed, pan and tilt joints, so the package ships no USD and nothing
has to be hosted on Nucleus. It runs with or without Kit.
`PAN_TILT_CAMERA_OFFSET` places a camera on its tilting link, and
`PAN_TILT_STEREO_OFFSETS` two eyes 6.5 cm apart. 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.

## Example

`isaaclab example foveated-camera` keeps its single camera and software
gaze. With `--stereo` it looks at the same YCB scene through two eyes
6.5 cm apart, which `binocular_gaze_angles` aims by a version and a
vergence:

- Below the viewer's Camera Source selector, sliders set the version
(tilt, pan) and the vergence; I/J/K/L and drags in the eyes' window turn
the version, and U/O converge and diverge the eyes. `--target` fixates
an object as the binocular teacher would, and a "Gaze to next object"
button glides both eyes onto the next object, the version and the
vergence arriving together.
- The viewer opens on a perspective view from beyond the objects that
draws each eye as an eyeball turned with its gaze, its line of sight,
and the point where they meet; a checkbox hides that overlay. A window
shows both eyes' cortical views side by side, and the camera menu offers
each eye.
- The eyeball is FOVI-Dex's
(`examples/assets/active_camera_eyeball.usda`, 0.8 MB in Git LFS, plain
preview-surface materials and no textures). It stays beside the examples
until it is uploaded to Nucleus. The viewer draws it as mesh instances,
so the eyes' own images never see it.

Both modes now light the scene by renderer. Since
#9165, Newton cameras read a dome light's intensity as
linear radiance, so the RTX-scale dome (900) washed their images out to
white; Newton now gets 1, and OVRTX and Isaac RTX keep 900. Core tasks
with RTX-scale domes, such as `reach` and `cabinet`, may be washed out
on Newton cameras the same way.

The separate `foveated-stereo` example from earlier revisions of this PR
is gone, so `isaaclab` itself is unchanged.

## Docs

"Gaze modes" and "Binocular gaze" sections on the Foveated Camera page,
each with a config example and a figure (below), plus API entries for
`GazeRigCfg`, binocular gaze, `binocular_gaze_angles` and
`isaaclab_fovi.assets`. The Binocular gaze section shows how to run
`foveated-camera --stereo`.

![Gaze
modes](https://github.com/nblauch/IsaacLab/blob/feat/isaaclab-fovi-stereo-vergence/docs/source/_static/overview/sensors/foveated_camera_gaze_modes.jpg?raw=true)

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.

![Binocular
gaze](https://github.com/nblauch/IsaacLab/blob/feat/isaaclab-fovi-stereo-vergence/docs/source/_static/overview/sensors/foveated_camera_binocular.jpg?raw=true)

Top: both eyes' 128 × 128 images at the end of each fixation. The
fixated object sits in both foveas, while nearer or farther objects fall
in different places in the two eyes. Below: the version jumps to each
object while the head turns after it, and the vergence follows the
object's distance. Hybrid gaze holds the version's direction rather than
a point, and turning the head moves the eyes, so for near objects the
teacher keeps adjusting the version and vergence while the head turns.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `main`

## Validation

At 250824d (the later commit adds the demo's eyeballs and controls; its
glide was checked headless through all 17 objects, ending each with the
lines of sight within 0.3 mm of the object, and the 56 simulator-free
cases still pass after merging `main`):

- Simulator-free: the 56 cases in `test_active_gaze.py`,
`test_camera_gaze.py` and `test_camera_cfg.py` pass. New in
`test_active_gaze.py`:
- one kernel step per rig mode, and the dual observation against
quaternion composition;
- through `GazeAction` itself, a hybrid gaze set on the camera starting
a new fixation, the hybrid teacher after a head turn, and the physical
teacher on a tilted head with a turn already queued;
- a target body named by a slice, and a world-point target reaching the
gaze term with its offset;
- for binocular gaze, the lines of sight meeting at the vergence's angle
in one plane with the baseline, the vergence's limits, hybrid version
with the head following, the teacher's labels for a point ahead and one
behind, the physical and hybrid teachers after head turns, and the
rejection of eyes on two bodies;
  - `binocular_gaze_angles` against the action's step;
  - the rig, action and binocular config checks.
- All 11 Newton and Isaac RTX render cases pass; the four OptiX cases
skip without `optix`. Two new cases run on both renderers:
- `test_hybrid_gaze_turns_the_head_onto_the_fixation` pans three steps
without reading the camera between steps. It checks that the retina
leads the head, that the head and the camera's world axis end on the
fixation with the retina back on the optical axis, and that after a
reset the gaze and its observation are zero and the next step commands
the rig's default pose. It fails without `update_mount`.
- `test_binocular_gaze_fixates_a_near_point_with_both_eyes` steps the
stereo head with the teacher's labels toward a point 0.4 m away and 15°
to the left. It checks that both optical axes pass within 1 mm of the
point, that the head carries the version and the vergence matches the
distance, and that a reset restores parallel lines of sight. Flipping
the vergence's direction in the kernel fails it and the vergence unit
test.
- `foveated-camera --stereo`, built headless on Newton and on Isaac RTX:
after fixating three objects 0.5 m to 1 m away, steering, and setting
the eyes parallel, the measured angle between the lines of sight equals
the vergence and their bisector the version to within 0.0001°, and the
lines meet within 0.2 mm of each object. Both it and the single-camera
mode render normally on Newton and open in the Newton viewer.
- The joint-id fix: with list ids, 180 steps of the binocular scene in
physical or hybrid gaze, rendering both eyes with CUDA graphs on,
faulted in the first steps; with mask writes, full-buffer writes or a
persistent id array they run to the end. The pre-merge commit ad23446
faulted the same way.

Earlier, with the converted USD mount, whose links, masses, limits and
drives the spawner reproduces:

- Rollouts of all four modes on Newton + Warp reach the commanded 13.5°
(physical settles at 13.47°).
- FOVI-Dex's clutter-lift task, moved onto this gaze action: its render
smoke passes with software and physical gaze on Newton + Warp and on
PhysX + Isaac RTX, and a policy acting in four-step chunks renders once
per chunk.
- The docs build passed with warnings as errors.

Not rerun: OVRTX, the standalone-script smoke test, the contrib PPO
cases, and the docs build since the last changes (the Binocular gaze
section and the `isaaclab_fovi.assets` and `isaaclab_fovi.mdp` API
pages).

**Rig step cost.** One rig gaze step with one kernel and a runtime mode
(806a5ee) and with one kernel per mode, which also composes the head and
retina rotations (b8c47ef), on an RTX 6000 Ada with Warp 1.17 and random
actions and joints. Each kernel is launched 10 times to warm up, then
100 launches are captured in a CUDA graph, replayed 5 times, and timed
over 200 replays.

| Environments | Mode | 806a5ee | b8c47ef |
| --- | --- | --- | --- |
| 4,096 | physical | 2.53 µs | 2.73 µs |
| 4,096 | hybrid | 3.20 µs | 3.49 µs |
| 4,096 | dual | 2.35 µs | 2.49 µs |
| 65,536 | physical | 2.78 µs | 3.24 µs |
| 65,536 | hybrid | 3.94 µs | 4.31 µs |
| 65,536 | dual | 2.73 µs | 3.17 µs |

Launched from Python, either takes about 13 µs a step, which is launch
overhead. Hybrid gaze reads the camera's pose each step
(`update_mount`), which a camera read for its image that step would have
done anyway.

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request, or `run-ci ovstage` to include
kitless OVStage rendering tests for that run.

- [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
isaaclab-bot Bot pushed a commit to isaac-sim/IsaacLab that referenced this pull request Dec 3, 2026
# Description

Follows #9074, which added `isaaclab_fovi`. This PR
now carries all of the active-gaze work: it includes
#9181 (gaze modes, now a draft), which was reviewed on
its own, and adds binocular gaze on top. Both were first reviewed in the
fork, as nblauch#6 and nblauch#7.

Following [FOVI-Dex](https://fovi-dex.github.io/), it lets a policy turn
a camera on a pan-tilt mount as well as the retina inside it, and fixate
a point with two foveated eyes on one head. Until now the gaze action
could only turn one camera's retina (software gaze). The
`foveated-camera` example's new `--stereo` mode shows binocular gaze.

**Fixes to `main`.** Three changes fix bugs in `gaze_teacher_labels`
from #9074, listed under Fixed in the changelog: it
rendered a frame for every label (see *Teacher pose reads*), a tracked
mount's teacher aimed from the mount of the step before (see *Mount
updates*), and a target naming the asset's only body raised a
`TypeError`, since Isaac Lab resolves body ids that cover every body to
a slice.

## Gaze modes (`isaaclab_fovi.mdp`)

`GazeActionCfg.mode` chooses what the gaze actions turn:

- `"software"` (the default, unchanged): the retina.
- `"physical"`: the rig's joints; each step adds to their last targets,
so a lagging head still reaches every command.
- `"hybrid"`: the retina at once, while the rig turns the camera after
it by at most `GazeRigCfg.max_step_deg` per step and the fixation holds
in the world.
- `"dual"` (experimental): four actions, the joints as in physical gaze
and then the retina, independently.

The `GazeAction` docstring and the Foveated Camera page describe each
mode in full. `GazeRigCfg` names the articulation and its pan and tilt
joints. The rig modes need `mount="tracked"` and a camera without image
roll. With a rig, `gaze_state` reports the fixation's direction from the
rig's zero pose, the head's turn composed with the retina's, so the
observation means the same in every mode. In physical gaze the retina
stays where the gaze action leaves it, on the optical axis, unless
something sets it directly with `FoveatedCamera.set_gaze_angles`; in
hybrid gaze such a call starts a new fixation, which
`FoveatedCamera.gaze_writes` lets the action tell apart from its own
writes.

`gaze_teacher_labels` labels from where the next step starts: in hybrid
gaze the software gaze re-aimed at its held fixation, and in physical
gaze the head's commanded pose, so it never repeats a turn the head has
made or has yet to make. Its target body may also be named when it is
the asset's only body.

- *Teacher targets in the world.* `gaze_teacher_labels` takes
`target_w`, a function of the environment that returns each
environment's target point, as an alternative to `target_cfg`. A target
chosen per environment, such as the object a command picks among
several, is not a point fixed to one asset.
- *Teacher pose reads.* The teacher took the camera's position from
`camera.data`, and reading a camera's data updates its image, so
labelling rendered a frame; a policy that observes every fourth control
step and labels every step rendered four frames for each one it used.
The teacher now reads the new `FoveatedCamera.mount_pos_w`, which
`update_mount` refreshes.

**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 and the head never settled. The tracked-mount teacher from
#9074 had the same one-step lag and now uses it too.

**Tracked mounts on Isaac RTX.** A tracked mount needed a renderer that
turns the camera's pose by the gaze, so the rig modes ran only on Newton
and OVRTX. An Isaac RTX camera holds its gaze in its prim, relative to
the prim's parent, so it already follows a moving mount; only the
recorded mount was missing. `update_mount` now reads it back from the
prim, without the gaze, and `mount="tracked"` works with every renderer.

## Binocular gaze (`isaaclab_fovi.mdp`)

- `BinocularGazeActionCfg` moves two eyes with three actions: the
**version**, their shared line of sight (tilt, pan), and the
**vergence**, the angle between their lines of sight. Each eye turns
from the version by half the vergence, toward the other eye, in the
plane that holds the version and the baseline, so the two lines of sight
always meet; the farther the fixation, the smaller the vergence.
- The version moves as a single camera's gaze does in `"software"`,
`"physical"` or `"hybrid"` gaze; the vergence always turns the retinas.
Both are in field radii, and the vergence stays between zero (parallel)
and `vergence_limit`.
- `binocular_gaze_state` observes the version, the vergence and their
velocities; with a rig, the version is its direction from the rig's zero
pose, as for `gaze_state`.
- `binocular_gaze_teacher_labels` labels the actions that fixate a point
with both eyes: the version bisects the eyes' lines of sight to it and
the vergence is their angle. The decomposition is exact, since the two
lines of sight are symmetric about their bisector. Like
`gaze_teacher_labels`, it starts from where the next step does, takes
`target_w`, reads both eyes' positions from `mount_pos_w` without
rendering, and checks each eye's visibility with its own camera.
- `binocular_gaze_angles` turns a version, a vergence and the baseline
between the eyes into each eye's gaze without an action term, through
the same Warp function as the action's step, so code outside a
manager-based environment can drive two foveated cameras with the same
geometry.
- The eyes need one body to carry them (their prims share a parent),
parallel optical axes, and the same retina, on any renderer: Newton,
OVRTX or Isaac RTX. The rig modes also need eyes without image roll.
- The gaze actions write the rig's joint targets with a persistent
joint-id array. A list became a new device array on every write, and
with cameras rendering, a captured Newton physics step faulted on that
freed memory.

Each gaze mode has its own Warp kernel, only hybrid gaze allocates the
fixation it holds, and a Warp kernel resets the reset environments.

## Pan-tilt mount (`isaaclab_fovi.assets`)

`PAN_TILT_CFG` is FOVI-Dex's two-joint pan-tilt mount, with no visual
geometry. `spawn_pan_tilt` builds it in the stage, its three links and
its fixed, pan and tilt joints, so the package ships no USD and nothing
has to be hosted on Nucleus. It runs with or without Kit.
`PAN_TILT_CAMERA_OFFSET` places a camera on its tilting link, and
`PAN_TILT_STEREO_OFFSETS` two eyes 6.5 cm apart. 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.

## Example

`isaaclab example foveated-camera` keeps its single camera and software
gaze. With `--stereo` it looks at the same YCB scene through two eyes
6.5 cm apart, which `binocular_gaze_angles` aims by a version and a
vergence:

- Below the viewer's Camera Source selector, sliders set the version
(tilt, pan) and the vergence; I/J/K/L and drags in the eyes' window turn
the version, and U/O converge and diverge the eyes. `--target` fixates
an object as the binocular teacher would, and a "Gaze to next object"
button glides both eyes onto the next object, the version and the
vergence arriving together.
- The viewer opens on a perspective view from beyond the objects that
draws each eye as an eyeball turned with its gaze, its line of sight,
and the point where they meet; a checkbox hides that overlay. A window
shows both eyes' cortical views side by side, and the camera menu offers
each eye.
- The eyeball is FOVI-Dex's
(`examples/assets/active_camera_eyeball.usda`, 0.8 MB in Git LFS, plain
preview-surface materials and no textures). It stays beside the examples
until it is uploaded to Nucleus. The viewer draws it as mesh instances,
so the eyes' own images never see it.

Both modes now light the scene by renderer. Since
#9165, Newton cameras read a dome light's intensity as
linear radiance, so the RTX-scale dome (900) washed their images out to
white; Newton now gets 1, and OVRTX and Isaac RTX keep 900. Core tasks
with RTX-scale domes, such as `reach` and `cabinet`, may be washed out
on Newton cameras the same way.

The separate `foveated-stereo` example from earlier revisions of this PR
is gone, so `isaaclab` itself is unchanged.

## Docs

"Gaze modes" and "Binocular gaze" sections on the Foveated Camera page,
each with a config example and a figure (below), plus API entries for
`GazeRigCfg`, binocular gaze, `binocular_gaze_angles` and
`isaaclab_fovi.assets`. The Binocular gaze section shows how to run
`foveated-camera --stereo`.

![Gaze
modes](https://github.com/nblauch/IsaacLab/blob/feat/isaaclab-fovi-stereo-vergence/docs/source/_static/overview/sensors/foveated_camera_gaze_modes.jpg?raw=true)

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.

![Binocular
gaze](https://github.com/nblauch/IsaacLab/blob/feat/isaaclab-fovi-stereo-vergence/docs/source/_static/overview/sensors/foveated_camera_binocular.jpg?raw=true)

Top: both eyes' 128 × 128 images at the end of each fixation. The
fixated object sits in both foveas, while nearer or farther objects fall
in different places in the two eyes. Below: the version jumps to each
object while the head turns after it, and the vergence follows the
object's distance. Hybrid gaze holds the version's direction rather than
a point, and turning the head moves the eyes, so for near objects the
teacher keeps adjusting the version and vergence while the head turns.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `main`

## Validation

At 250824d (the later commit adds the demo's eyeballs and controls; its
glide was checked headless through all 17 objects, ending each with the
lines of sight within 0.3 mm of the object, and the 56 simulator-free
cases still pass after merging `main`):

- Simulator-free: the 56 cases in `test_active_gaze.py`,
`test_camera_gaze.py` and `test_camera_cfg.py` pass. New in
`test_active_gaze.py`:
- one kernel step per rig mode, and the dual observation against
quaternion composition;
- through `GazeAction` itself, a hybrid gaze set on the camera starting
a new fixation, the hybrid teacher after a head turn, and the physical
teacher on a tilted head with a turn already queued;
- a target body named by a slice, and a world-point target reaching the
gaze term with its offset;
- for binocular gaze, the lines of sight meeting at the vergence's angle
in one plane with the baseline, the vergence's limits, hybrid version
with the head following, the teacher's labels for a point ahead and one
behind, the physical and hybrid teachers after head turns, and the
rejection of eyes on two bodies;
  - `binocular_gaze_angles` against the action's step;
  - the rig, action and binocular config checks.
- All 11 Newton and Isaac RTX render cases pass; the four OptiX cases
skip without `optix`. Two new cases run on both renderers:
- `test_hybrid_gaze_turns_the_head_onto_the_fixation` pans three steps
without reading the camera between steps. It checks that the retina
leads the head, that the head and the camera's world axis end on the
fixation with the retina back on the optical axis, and that after a
reset the gaze and its observation are zero and the next step commands
the rig's default pose. It fails without `update_mount`.
- `test_binocular_gaze_fixates_a_near_point_with_both_eyes` steps the
stereo head with the teacher's labels toward a point 0.4 m away and 15°
to the left. It checks that both optical axes pass within 1 mm of the
point, that the head carries the version and the vergence matches the
distance, and that a reset restores parallel lines of sight. Flipping
the vergence's direction in the kernel fails it and the vergence unit
test.
- `foveated-camera --stereo`, built headless on Newton and on Isaac RTX:
after fixating three objects 0.5 m to 1 m away, steering, and setting
the eyes parallel, the measured angle between the lines of sight equals
the vergence and their bisector the version to within 0.0001°, and the
lines meet within 0.2 mm of each object. Both it and the single-camera
mode render normally on Newton and open in the Newton viewer.
- The joint-id fix: with list ids, 180 steps of the binocular scene in
physical or hybrid gaze, rendering both eyes with CUDA graphs on,
faulted in the first steps; with mask writes, full-buffer writes or a
persistent id array they run to the end. The pre-merge commit ad23446
faulted the same way.

Earlier, with the converted USD mount, whose links, masses, limits and
drives the spawner reproduces:

- Rollouts of all four modes on Newton + Warp reach the commanded 13.5°
(physical settles at 13.47°).
- FOVI-Dex's clutter-lift task, moved onto this gaze action: its render
smoke passes with software and physical gaze on Newton + Warp and on
PhysX + Isaac RTX, and a policy acting in four-step chunks renders once
per chunk.
- The docs build passed with warnings as errors.

Not rerun: OVRTX, the standalone-script smoke test, the contrib PPO
cases, and the docs build since the last changes (the Binocular gaze
section and the `isaaclab_fovi.assets` and `isaaclab_fovi.mdp` API
pages).

**Rig step cost.** One rig gaze step with one kernel and a runtime mode
(806a5ee) and with one kernel per mode, which also composes the head and
retina rotations (b8c47ef), on an RTX 6000 Ada with Warp 1.17 and random
actions and joints. Each kernel is launched 10 times to warm up, then
100 launches are captured in a CUDA graph, replayed 5 times, and timed
over 200 replays.

| Environments | Mode | 806a5ee | b8c47ef |
| --- | --- | --- | --- |
| 4,096 | physical | 2.53 µs | 2.73 µs |
| 4,096 | hybrid | 3.20 µs | 3.49 µs |
| 4,096 | dual | 2.35 µs | 2.49 µs |
| 65,536 | physical | 2.78 µs | 3.24 µs |
| 65,536 | hybrid | 3.94 µs | 4.31 µs |
| 65,536 | dual | 2.73 µs | 3.17 µs |

Launched from Python, either takes about 13 µs a step, which is launch
overhead. Hybrid gaze reads the camera's pose each step
(`update_mount`), which a camera read for its image that step would have
done anyway.

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request, or `run-ci ovstage` to include
kitless OVStage rendering tests for that run.

- [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

(cherry picked from commit eb1b21b)
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