Repository navigation
Add isaaclab_fovi foveated camera sensors and active-gaze camera tasks - #9074
Conversation
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Design and architecture (1), Scope and over-engineering (6), API (3), Implementation (5), Style consistency (9), Test quality (7). Other reviewed categories look good.
- PR description: Title matches sensors/tasks; shorten repeated camera prose, correct fixed-prim claims, and link reproducible env.step/memory comparisons with revisions, commands, software versions, warmup, and measurement methods; hardware, backends, environment counts, and metrics are supplied.
- Design and architecture: GazeActionCfg imports Warp runtime implementation during task configuration; separate the declarative configuration and reference GazeAction through a resolvable string.
- Scope and over-engineering: Minimal implementation: Extend Camera and existing task/PPO owners; keep initializers, examples, test helpers, remaining sensor modules, mdp/gaze, PPO/config, and task registration/config/agent modules; merge virtual_gaze into foveated_camera and foveated_rays into foveated_newton_camera; delete unused teacher and OpenCV paths, share accessors, and defer unused grid buffers. Suggested PR breakdown: sensor/package integration with renderer validation; gaze/PPO with update validation; tasks with registration and training validation.
- API: The documented camera_model with spawn=None path fails for OVRTX distance output; obtain the near clipping distance from the referenced camera prim.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Both backends convert integer segmentation IDs through float32, corrupting values above 2²⁴; preserve integer precision during discrete pooling.
- Style consistency: Custom sensor exports and direct MDP/RSL-RL exports bypass the required stub-owned loader; use lazy_export() with explicit distributed .pyi stubs.
- Test quality: The next-frame test waits four updates after changing gaze, allowing delayed updates to pass; assert the first frame after the command.
Significant concerns. Posted 31 inline findings.
Automated review; human maintainers own approval decisions.
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Scope and over-engineering (5), API (4), Implementation (6), Style consistency (5), Test quality (6). Other reviewed categories look good.
- PR description: Title matches; correct fixed-prim and Kuka-resolution claims, distinguish parametrized cases from unit tests, trim pending-sweep prose, and attach revisions, commands, warmup, and software conditions to supplied timing, throughput, and memory measurements.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: Minimal implementation: extend Camera and existing task configurations; merge virtual_gaze into FoveatedCamera and foveated_rays into Newton, replacing ray-packing kernels with native operations; delete the OpenCV fallback and duplicate gaze storage. Keep all remaining sensors/, mdp/, rsl_rl/, tasks/, examples/*, export modules, and test-support modules for their geometry, configuration, runtime, or validation contracts. Suggested PR breakdown: sensors, packaging, and backend-render validation; gaze terms and capture validation; PPO and task registration with training validation.
- API: OVRTX distance output dereferences spawn despite documented spawn=None support; obtain clipping distance from the referenced camera.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Grid publication rewrites unrendered environments using current gaze masks, corrupting their cached frames; restrict publication to updated environments.
- Style consistency: Public export modules bypass required stub-backed lazy_export, adding parallel export ownership; replace their maps and eager imports with lazy_export and distributed init.pyi stubs.
- Test quality: The next-frame test waits four frames after changing gaze, allowing propagation delays to pass; assert the first post-command render after warming up.
Significant concerns. Posted 26 inline findings.
Automated review; human maintainers own approval decisions.
[Medium impact] The PR appears safe to merge; the test cleanup warning is non-blocking. Findings
SummaryAdds
Reviews (3) · Last reviewed commit: "Test the review fixes at their boundarie..." · Reviewed by Greptile |
|
Thanks for the reviews. 9c192b3 addresses them as follows. Fixed
Restructured
Tests
Kept, with reasons
|
|
@isaaclab-review-bot review |
|
@greptileai review |
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Design and architecture (1), Scope and over-engineering (2), API (2), Implementation (6), Style consistency (5), Test quality (3). Other reviewed categories look good.
- PR description: Title matches; replace “Nothing else changes” with “core runtime unchanged,” remove pending-sweep prose, and retain supplied hardware/backend/environment measurements while adding revisions, commands, warmup and timing/memory methods for reproducibility.
- Design and architecture: FoveatedCameraCfg overrides explicit spawn settings across renderers; keep configuration declarative and apply required camera-lock changes during RTX construction.
- Scope and over-engineering: Minimal implementation: Extend Camera, ActionTerm and stock task configurations; keep all sensor modules, exports/stubs, MDP, PPO/config, task modules, examples and test-support modules for their runtime or public contracts, deleting canonical_to_grid and collapsing ModalPooler into camera-owned tables. Essential flow remains sampling, rendering, publication, gaze and supervision. Suggested PR breakdown: sensors/install/docs with renderer validation; gaze/PPO with action/training validation; task configurations/registrations with task-resolution validation.
- API: GazeAction ignores supplied action values and reads manager state instead; consume the argument through the stable launch buffer so direct calls honor the action-term interface.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Non-fused camera postprocessing modifies inactive rows using current gaze, corrupting cached frames; carry the render-update mask through extraction, masking, pooling and publication.
- Style consistency: GazeActionCfg shares its runtime implementation module and directly references GazeAction; separate configuration with a resolvable class_type to preserve the prescribed import boundary.
- Test quality: Renderer density cases assert sampling metadata rather than rendered spacing, allowing ignored foveated rays to pass; assert independent off-center rendered distances or retain one geometry case.
Significant concerns. Posted 19 inline findings.
Automated review; human maintainers own approval decisions.
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Design and architecture (3), API (2), Implementation (5), Style consistency (8), Test quality (5). Other reviewed categories look good.
- PR description: Title and feature scope match; hardware, backends, counts, and measurements are supplied, but qualify fixed-mount behavior, shorten training prose while preserving template sections, and supply benchmark revisions, commands, environment, warmup, and metric methods.
- Design and architecture: RTX cameras retain owned lens directories after closure; release them at camera teardown after renderer borrowers, rather than relying on garbage collection.
- Scope and over-engineering: No over-engineering issues.
- API: Short gaze batches resize state below the camera count while pose updates still traverse every camera; validate shape (num_envs, 2) before changing storage.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Newton and RTX non-fused postprocessing ignores update masks, applying current gaze to cached frames; restrict masking, pooling, extraction, and publication to rendered rows.
- Style consistency: Gaze configuration resides with runtime kernels and directly references its implementation; separate declarative configuration and use a resolvable class string to preserve the required import boundary.
- Test quality: Simulator-free pooling and Newton-buffer files lack kitless markers, excluding them from marker-based CI selection; mark both files while retaining distinct physical, backend, precision, frame, and packaging coverage.
Significant concerns. Posted 23 inline findings.
Automated review; human maintainers own approval decisions.
|
@isaaclab-review-bot review |
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Design and architecture (3), Scope and over-engineering (2), API (1), Implementation (3), Style consistency (5), Test quality (4). Other reviewed categories look good.
- PR description: The title matches; qualify “Nothing else changes”; retain supplied hardware/backend/environment measurements, but add baseline/candidate revisions, commands, warmup and metric methodology; replace unfinished-sweep promises with linked results.
- Design and architecture: Isaac RTX authors lens settings during initialization rather than construction; prepare and author them before scene cloning to preserve the required camera-authoring boundary.
- Scope and over-engineering: Minimal implementation: Extend Camera, ActionTerm, PPO and stock task configurations; keep all added sensors, mdp, rsl_rl, task, export, example and test-support modules for their runtime or contract responsibilities; delete ModalPooler, reuse the existing neighbour table, and inline _foveate. Essential flow remains sampling, rendering, publication, gaze and supervision. Suggested PR breakdown: (1) sensors, pooling and packaging—geometry/publication tests; (2) gaze and PPO—fixation/update tests; (3) tasks and documentation—configuration resolution and task validation.
- API: GazeSupervisedPPO is missing from its package’s lazy exports, preventing the paired public import; add its named stub import and all entry.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Unpooled Newton sample-set publication aliases buffers redrawn for every environment, overwriting unselected frames; publish into stable storage and copy only updated rows.
- Style consistency: Added camera classes violate the prescribed member ordering, making lifecycle and public interfaces harder to locate; place constructors first, then properties, public methods and private methods.
- Test quality: The zero-coefficient PPO test checks logs and finiteness without proving optimization, so a no-op update passes; compare its update against stock PPO using the same rollout.
Significant concerns. Posted 18 inline findings.
Automated review; human maintainers own approval decisions.
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Design and architecture (2), Scope and over-engineering (2), API (2), Implementation (4), Style consistency (5), Test quality (5). Other reviewed categories look good.
- PR description: Title matches; replace “Nothing else changes” with “Core runtime unchanged,” remove pending-sweep prose, and make supplied step-time/memory comparisons reproducible with revisions, commands, software, hardware, backends, environment counts, warmup, and measurement methods.
- Design and architecture: GazeAction duplicates camera-owned gaze, so public camera commands leave observations and teacher labels stale; derive action gaze from the camera.
- Scope and over-engineering: Minimal implementation: extend Camera, ActionTerm, and existing fovi poolers; delete ModalPooler and collapse Torch masking handoffs into Warp operations, preserving geometry→render→publication flow. Keep all listed sensor, MDP, RSL-RL, task, export/configuration, example, and test-support modules for their contracts or resource lifecycles. Suggested PR breakdown: sensors and packaging with backend render validation; optional pooling with dtype/publication validation; gaze, PPO, and tasks with action/training validation.
- API: Direct installation omits fovi despite public configuration imports requiring it; declare fovi>=2.6 in the package dependencies.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Unpooled Newton sample-set output aliases a buffer redrawn for every environment, allowing partial updates to alter unselected frames; publish selected rows into stable camera-owned storage.
- Style consistency: FoveatedRTXCamera places properties and static hooks before its dunder methods, violating the required member order; move construction and destruction methods first.
- Test quality: The zero-coefficient PPO test accepts a no-op optimizer because zero oracle metrics and finite parameters still pass; compare its parameter update against stock PPO on the same rollout.
Significant concerns. Posted 20 inline findings.
Automated review; human maintainers own approval decisions.
maxkra15
left a comment
There was a problem hiding this comment.
The aggregate wheel drops the Fovi task entry point. Can we preserve it and check isaaclab list-envs --keyword Fovi from an installed wheel?
|
@isaaclab-review-bot review |
…heck PPISP and other tensor processors, and the deprecated isp_cfg, process pixel images, so FoveatedCameraCfg now refuses them. Newton's tiled kernel skips pixels past a partial tile, so a native grid renders at its own size without a tile-multiple check.
Each render test file builds one scene per backend and runs its cases on it. Merge overlapping simulator-free tests, share one camera stub in test_newton_buffers, and drop tests whose behaviour the remaining ones already catch.
fovi 2.7 moves scikit-image, fastcore and plum-dispatch into its optional extras and replaces pygeodesic with its own geodesic solver, so the lock drops beartype, fastcore, plum-dispatch, pygeodesic, scikit-image and tifffile. Against main, the extra now adds only fovi and OpenEXR.
|
run-ci |
save_exr writes the two float32 lookup textures as ZIP-compressed scanline EXR files with NumPy and zlib, so the fovi extra no longer needs OpenEXR and adds only fovi. The files hold the same pixels as OpenEXR's, and OpenEXR and OpenCV read them back exactly. A test decodes them following the EXR layout, with the channels in the alphabetical order the format requires.
The Foveated Camera page moves from the Sensors concepts to Experimental Features, next to the visuo-tactile sensor, and leaves the Sensors index. The Camera, Configure Rendering, Demos and installation pages point to it as experimental; Configure Rendering keeps a one-line pointer instead of its own section. The code stays in isaaclab_fovi.
Experimental features ship runnable scripts as examples, like the visuo-tactile sensor's, so foveated-camera moves to examples/sensors and runs with isaaclab example foveated-camera. It leaves the Demos page; its controls and commands move onto the experimental Foveated Camera page.
|
run-ci |
| sim_utils.create_new_stage() | ||
| sim = sim_utils.SimulationContext(cfg.sim) | ||
| centres = _add_clutter(cfg.scene) | ||
| compare = any(v.backend.visualizer_type == "newton" for v in cfg.sim.visualizer_cfgs) |
There was a problem hiding this comment.
if this just supported by Newton visualizer, make sure we add a helpful warning msg if another visualizer is tried
There was a problem hiding this comment.
Added before the merge. With any visualizer other than Newton's, the example now warns that its gaze keys and viewing-sphere panel need --viz newton, and that the gaze stays where it starts (--target). --viz newton_rtx is the Newton viewer drawing with OVRTX, so it doesn't warn.
| ), | ||
| "examples/demos/microduck_warehouse.py": ScriptOverride(fixed_physics_backend="newton_xpbd"), | ||
| "examples/sensors/foveated_camera.py": ScriptOverride( | ||
| fixed_physics_backend="newton_xpbd", visualizers=(None, "newton_gl", "newton_rtx") |
There was a problem hiding this comment.
let's also use "newton" rather than "newton_gl" for the visualizer. we are renaming the "newton_gl" visualizer to "newton", though both names are supported.
There was a problem hiding this comment.
Done before the merge, here and in the stereo example (#9183). It also closed a gap: the smoke harness only recognises newton (and kit), so the newton_gl and newton_rtx entries were always skipped. The case now runs the example in the Newton viewer wherever a display is available.
|
idea: the I/J/K/L and O/U keys work fine, but perhaps we could add gaze and magnify sliders in the Newton viewer's side panel? the user can play with the values in the example and just any scene with a foveated camera, without restarting & going through code / cli |
The example's gaze keys and viewing-sphere panel use the Newton viewer, so with any other visualizer it now warns that the gaze stays where it starts. It defaults to the newton visualizer name, which replaces newton_gl, and its standalone-script case lists newton so the smoke test runs it in the viewer.
|
run-ci |
|
let's address visualizer updates in a follow up |
# Description Follows #9074, which added `isaaclab_fovi` and the `foveated-camera` example. This adds the viewer controls suggested in its review, so a foveated camera can be steered and its foveation changed while watching it. It also fixes the example's crash on Isaac RTX, a bug on `main`. **Viewer controls** (`isaaclab_fovi.sensors`, `isaaclab_visualizers`) - When a foveated camera is a Newton viewer window's camera source, its controls appear below the Camera Source selector, in the Camera Sensor section: gaze tilt and pan sliders, a "Center gaze" button, and a foveation selector. Choosing another source hides them, and a camera the viewer cannot show has none; nothing in `FoveatedCameraCfg` configures them. Each camera registers its controls when it is built, they reach every Newton window at the next simulation reset, and the registration is removed when the camera is garbage-collected; no task code is needed. A change in one window redraws the camera view in every window. - To place them there, the Newton visualizer gains a small, sensor-agnostic hook, `NewtonVisualizerBase.register_sensor_ui_callback(callback)`: while a scene sensor is the camera source, each callback is called every UI frame with `imgui` and that sensor, in the Camera Sensor section after its channel and environment controls, and draws only for the sensors it handles. The environment controls move into `_draw_sensor_envs`, so that their early return for a single-environment sensor does not skip the callbacks. Everything foveated stays in `isaaclab_fovi`. - The sliders follow the camera's gaze, so they move when the gaze is set elsewhere (an action, a teacher, the example's drag), and moving them sets it. - The foveation selector steps through a discrete, log-spaced set of CMF constants, `ViewerGazeControls.cmf_a_values` (0.001° to 1000° in decades by default), plus the camera's configured `cmf_a`. Assigning that class attribute changes the stops for every camera; the sliders read it as they draw. `ViewerGazeControls` is exported from `isaaclab_fovi.sensors` and documented for this. - `FoveatedCamera.set_cmf_a(cmf_a_deg)` changes the CMF constant at runtime. It rewrites the rendered rays in place and caches one retina per value until the camera is initialized again, so switching back reuses the cached retina instead of building it. A value's retina is built only when the slider first reaches it. It is supported for Newton cameras whose sample count does not depend on `cmf_a` (the warped-Cartesian styles and the `_fixn` isotropic ones); other cameras raise, and their controls show the value as fixed with the reason. OVRTX and Isaac RTX read the retina's lens textures once, when the renderer loads the stage. **Example** (`examples/sensors/foveated_camera.py`) - The eye sits in the viewer's scene-camera slot, so WASD, the arrow keys and Q/E move the camera mount as for any scene camera. As the window's camera source, it has its controls below Camera Source; the overview camera the comparison is drawn from is not a source, so it has none. - `--cmf_a_values 0.2,2,20` sets the foveation selector's stops (`ViewerGazeControls.cmf_a_values`), with the eye's own `cmf_a` added. The values are comma-separated, so the overrides after the flag stay overrides. - The comparison shows the viewing sphere beside the foveated camera's cortical view, the image the camera publishes, without a header: its titles added little, and its `cmf_a` readout repeated the foveation selector. It covers the view once it opens, and again when the view is resized; otherwise the user can move or resize it. Dragging on it, or I/J/K/L, steers the gaze only; the mount never moves with it. - The O/U keys that magnified the comparison's cortical view are removed: the comparison now shows the cortical view the viewer shows, and the foveation slider changes the retina itself. They arrived with #9074, merged hours before this PR and in no release, so nothing depends on them. - The comparison redraws only when the viewer shows a new frame of the eye, or the gaze or foveation it overlays changes, and its cortical view is that frame. Redrawing every loop showed OVRTX's frame-to-frame sampling noise on a still scene as flicker, since the viewer itself keeps the last frame until the scene, the gaze or a slider changes. - **Fix:** on `main`, the example's `isaacsim_rtx` preset (`renderer=isaacsim_rtx`) crashes while Kit starts: the example's top-level imports, `pxr` and the `FoveatedCamera` and `BaseVisualizer` classes, load the pip USD library before `launch_simulation` starts Kit, whose own USD then fails to load. The example now imports `pxr` in the clutter helper, which runs after launch, and the two classes only for type checking, as the `microduck-warehouse` demo keeps runtime imports out of module scope. The fix is listed under Fixed in `isaaclab`'s changelog, where the example was added. **Docs.** The Foveated Camera page describes the controls below Camera Source and the example's interaction, and its Sampling section names the image the camera publishes the foveated camera's cortical view. The API page documents `ViewerGazeControls.cmf_a_values`. ## Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## Validation - Three new simulator-free cases in `test_camera_gaze.py`. Two drive the controls through a stand-in ImGui: the sliders follow a gaze set elsewhere and set it in every Newton window, a window draws them only while the camera is its source, each camera's widgets get their own ID scope, the foveation selector shows and switches `cmf_a` among `ViewerGazeControls.cmf_a_values` and keeps the starting value as an option (or shows it as fixed), and each foveated camera adds its controls on reset until it is gone. The third checks that the RTX camera, which OVRTX and Isaac RTX share, refuses `set_cmf_a`. - A new case in `isaaclab_visualizers`' `test_newton_task_views.py` checks that sensor UI callbacks draw in the Camera Sensor section, after its channel and environment controls and in registration order, with the selected sensor. `test_newton_adapter.py::test_newton_scene_camera_controls_apply_uniformly_to_active_copies` fails only when run in one process after `test_camera_gaze.py`, with or without the visualizer change; each file passes on its own. - A new Newton render case, `test_cmf_a_switches_the_retina_at_runtime`, checks that building the camera added its viewer controls, then switches a fixed-count camera's `cmf_a` and checks, on Newton Warp and OptiX, that each sample renders along its new ray, the outputs keep their shape, and switching back restores the first image. - A plain scene with a foveated camera beside an ordinary `CameraCfg`, whose only viewer setting is the stock `streaming_view=True`: switching the window's Camera Source, the Camera Sensor section shows the foveated camera's controls with it selected, and nothing extra with the ordinary camera or the perspective view. - The example, run through the Newton viewer's windowed draw path off-screen on OVRTX and Newton: on a still scene the comparison is drawn once; while the gaze moves it redraws when the gaze changes and again with the next eye frame, and inside the retina's disc it matches the main view pixel for pixel. The window placement was checked in an ImGui frame: it covers the view once the window exists and leaves a moved window where the user put it. Also checked by hand in a window on OVRTX. - The Isaac RTX fix: `isaaclab example foveated-camera renderer=isaacsim_rtx` crashes at Kit startup on `main` and runs on this branch, headless and with the Newton viewer, and the retina follows a gaze set at runtime on Isaac RTX as on Newton. Loading the example module no longer maps any USD library before Kit starts. - In the example on Newton, with `--cmf_a_values 0.2,2,20` the foveation selector has the four stops 0.2, 0.591, 2 and 20; with the defaults, switching the eye to 0.001° and to 1000° rebuilds the retina and renders. A negative value is rejected, and the flag before `renderer=isaacsim_rtx` leaves that override in place. - The standalone-script smoke test launches the example through the `isaaclab` CLI. - The docs build passes with warnings as errors, including the `ViewerGazeControls` API entry and the updated Foveated Camera page. ## 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
# 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`.  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.  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
# 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`.  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.  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)
Description
Adds
isaaclab_fovi, a foveated camera for Isaac Lab built on the 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 withuv run --extra fovi isaaclab example foveated-camera.Camera (
isaaclab_fovi.sensors, depends only onisaaclab)FoveatedCamera/FoveatedCameraCfgwork with thenewton_warp,newton_optix,isaac_rtxandovrtxrenderers. Newton casts one ray per retinal sample; RTX and OVRTX render through a lens lookup texture.spawndescribes (an ideal pinhole, or the OpenCV model inspawn.distortion), or any calibrated camera given ascamera_model.camera.set_gaze_angles(angles_deg). The gaze stays relative to the mount when the mount moves, andget_world_posesreports the mount on every renderer.mask_to_sensor_fovzeroes samples outside the physical camera's image.cmf_a_degsets the strength of foveation (default 0.591 deg, an estimate from human data); a large value gives a matched non-foveated baseline.(num_envs, H, W, C)image, asProxyArrayvalues like the coreCamera. Sample-set styles publish(num_envs, N, 1, C); they are experimental on RTX.pool_enabled,pool_mode); segmentation pools by modal label in its own dtype (pool_int_mode="modal"). Withmask_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_matricesleaves a foveated camera as configured and warns, as the core camera does for OpenCV lens models.FoveatedCameraCfgrejectstensor_processors(such as PPISP) andisp_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, andgaze_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-Foviinisaaclab_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 thefoviextra is installed. ItsGazeSupervisedPPOadds a mean-only gaze supervision loss, and itsGazeGaussianDistributionhead 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'sSamplingCoordsandGridPoolingLayerexactly. The page documents thefoveated-cameraexample (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 forisaaclab_fovi.mdpandisaaclab_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_imageand reads its keys withis_key_down: I/J/K/L steer the gaze and O/U magnify the panel's retina. The PR does not changeisaaclab_visualizers.Simplification. nblauch#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 andfovi>=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 rootpyproject.toml(the extra) and its extras test,uv.lock,docker/Dockerfile.baseand.github/workflows/build.yaml(CI installs the extra and runs the package's tests), the docs, andisaaclab/programs.pywith the standalone-script cases inisaaclab/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
Validation
isaaclab_fovibuilds 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 undersource/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 undersource/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 stepsIsaacContrib-Cartpole-Camera-Fovi, and the standalone-script smoke test launches thefoveated-cameraexample.Testing burden
Measured on one RTX 6000 Ada with warm Warp caches, each test file in its own process as CI runs them:
isaaclab_foviand the contrib PPO test)CI runs them in the existing job for
isaaclab_assets,isaaclab_contrib,isaaclab_teleop,isaaclab_mimicandisaaclab_experimental. The Docker base image installs thefoviextra, which addsfovi.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.steptime ± 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.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).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-cion the pull request.pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there