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 |
| from isaaclab_tasks.utils.hydra import resolve_task_config | ||
| from isaaclab_tasks.utils.presets import MultiBackendRendererCfg | ||
|
|
||
| OFFSET = (0.5, 0.5) |
There was a problem hiding this comment.
would this make more sense to be an example instead of demo since it's showing a specific feature and how to use it?
There was a problem hiding this comment.
i think @AntoineRichard had asked to make it a demo
There was a problem hiding this comment.
We'd like to keep it as a demo: it's an interactive scene you drive from the keyboard (gaze with I/J/K/L, magnify the retina with O/U) and it sits in the demo browser next to the other showcase demos. How to configure and use the sensor is covered by the sensor docs page (concepts/sensors/foveated_camera), whose snippets are what an example would repeat.
| { url = "https://files.pythonhosted.org/packages/77/f5/21d2de20e8b8b0408f0681956ca2c69f1320a3848ac50e6e7f39c6159675/babel-2.18.0-py3-none-any.whl", hash = "sha256:e2b422b277c2b9a9630c1d7903c2a00d0830c409c59ac8cae9081c92f1aeba35", size = 10196845, upload-time = "2026-02-01T12:30:53.445Z" }, | ||
| ] | ||
|
|
||
| [[package]] |
There was a problem hiding this comment.
could you make sure we have OSRBs filed for these new dependencis?
There was a problem hiding this comment.
Will do. We trimmed the list first. fovi 2.7 moves scikit-image, fastcore and plum-dispatch into its optional extras, and replaces pygeodesic with its own geodesic solver, which matches pygeodesic to float64 rounding. Every remaining base requirement of fovi is already in Isaac Lab's lock. So the fovi extra adds just two packages, both named in it: fovi (MIT) and OpenEXR (BSD-3, which writes the RTX/OVRTX lens lookup textures and needs only numpy).
There was a problem hiding this comment.
Update: we dropped OpenEXR as well. The camera now writes its two RTX lens textures (float32 EXR files) itself with NumPy and zlib. The files hold the same pixels as OpenEXR's, and OpenEXR and OpenCV both read them back exactly. So the fovi extra adds a single package to the lock: fovi (MIT).
There was a problem hiding this comment.
OSRB filed for fovi: https://nvbugspro.nvidia.com/bug/7141011
| @@ -0,0 +1,4 @@ | |||
| Changelog | |||
There was a problem hiding this comment.
what are your thoughts of having this under the isaaclab_contrib module for now until we have more examples?
There was a problem hiding this comment.
We'd prefer to keep isaaclab_fovi as its own package. It carries its own optional dependency (the fovi extra) and its own version and changelog, so users who don't install the extra never import it, and its tests run in their own job. Moving it into isaaclab_contrib would put the fovi requirement on contrib as a whole.
There was a problem hiding this comment.
Following up: the Foveated Camera page now lives under Experimental Features (experimental-features/foveated_camera), next to the visuo-tactile sensor, and is out of the Sensors index. The Camera, Configure Rendering and installation pages point to it as experimental. The demo is now an example, as you first suggested: isaaclab example foveated-camera, from examples/sensors/, documented on that page like the tactile sensor's example and off the Demos page. The code stays in isaaclab_fovi, the way MDP2's experimental docs cover its own isaaclab_experimental package, so the sensors and gaze terms stay together and fovi stays behind the fovi extra. One correction to my earlier reply: contrib loads its subpackages lazily, so moving the code there would not have forced fovi on every contrib user. We kept the separate package to keep the foveated pieces together.
| update_latest_camera_pose: bool = True | ||
| """Update the camera pose every frame. Newton and OVRTX require it: their pose update applies the gaze.""" | ||
|
|
||
| def __post_init__(self): |
There was a problem hiding this comment.
would this cfg work together with the new post processor options that were added like PPISP? maybe we need to add some checks to reject them if they can't work in conjunction
There was a problem hiding this comment.
Good catch: they process pixel images and a foveated camera publishes retinal samples, so they can't compose. FoveatedCameraCfg.__post_init__ now raises a ValueError for tensor_processors or isp_cfg, and test_camera_cfg.py covers both.
| {name: value.torch.squeeze(2) for name, value in self._flat_render_output.items()} | ||
| ) | ||
|
|
||
| def _validate_native_render_layout(self, tile_width: int, tile_height: int) -> None: |
There was a problem hiding this comment.
I'm not sure I fully understand the reason for this check, but my agent believes it's not necessary?
There was a problem hiding this comment.
Agreed, removed. Newton's tiled kernel skips pixels past a partial tile, so a native grid can render at its own size.
| assert (camera._gaze_validity() == expected).float().mean() > 0.999 | ||
|
|
||
|
|
||
| def test_only_a_turned_mount_is_recorded(monkeypatch) -> None: |
There was a problem hiding this comment.
can combine with test_rtx_world_poses_are_the_mount_so_a_round_trip_keeps_mount_and_gaze?
There was a problem hiding this comment.
Merged into test_rtx_world_poses_are_the_mount_and_only_a_turned_mount_is_recorded.
|
|
||
|
|
||
| @pytest.mark.parametrize("device", test_devices(DeviceScope.DEFAULT_CUDA)) | ||
| def test_published_grid_copy_is_graph_capturable(device: str) -> None: |
There was a problem hiding this comment.
can combine with test_upright_grid_masks_and_channel_aliases?
There was a problem hiding this comment.
Merged into test_upright_grid_masks_aliases_and_graph_capture.
| return gaze * (limit / gaze.norm(dim=-1, keepdim=True).clamp_min(limit)) | ||
|
|
||
|
|
||
| def test_gaze_step_kernel_matches_the_torch_update(): |
There was a problem hiding this comment.
can combine with test_process_actions_moves_the_gaze_by_the_supplied_actions?
There was a problem hiding this comment.
Merged into test_process_actions_moves_the_gaze_by_the_supplied_actions.
| @pytest.mark.parametrize( | ||
| ("style", "pool_k", "sample_cortex"), [("warped_cartesian_as_grid", 9, False), ("isotropic", 3, False)] | ||
| ) | ||
| def test_modal_pooling_uses_the_poolers_neighbourhoods(monkeypatch, style: str, pool_k: int, sample_cortex) -> None: |
There was a problem hiding this comment.
can combine with test_modal_pooling_keeps_majority_color_vector?
There was a problem hiding this comment.
Merged with the majority-colour test into test_modal_pooling_keeps_the_majority_label_over_the_poolers_neighbourhoods.
| torch.testing.assert_close(camera.sensor_fov_valid_fraction, seen) | ||
|
|
||
|
|
||
| def test_pooled_segmentation_publishes_modal_labels_at_full_precision(monkeypatch) -> None: |
There was a problem hiding this comment.
can combine with test_modal_pooling_preserves_ids_above_float_precision?
There was a problem hiding this comment.
Merged into test_modal_pooling_preserves_ids_above_float_precision, which checks both the camera's publication and the pooling function.
Revert the scene-camera compositor in isaaclab_visualizers. The demo now logs its viewing-sphere panel with the viewer's log_image and reads I/J/K/L gaze and O/U zoom keys with is_key_down, matching the newton visualizer type that newton_gl and newton_rtx now alias.
…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
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