Skip to content

Add viewer gaze and foveation controls for foveated cameras - #9182

Merged
kellyguo11 merged 13 commits into
isaac-sim:mainfrom
nblauch:feat/isaaclab-fovi-viewer-controls
Nov 25, 2026
Merged

kellyguo11 merged 13 commits into
isaac-sim:mainfrom
nblauch:feat/isaaclab-fovi-viewer-controls

Conversation

@nblauch

@nblauch nblauch commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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 Add isaaclab_fovi foveated camera sensors and active-gaze camera tasks #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.

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

Every foveated camera adds a collapsing section to the Newton viewer's side
panel with gaze tilt and pan sliders that follow the camera's gaze, a center
button, and a discrete log-spaced cmf_a selector (viewer_gaze_controls,
viewer_cmf_a_values). Newton cameras with a fixed sample count change cmf_a at
runtime through FoveatedCamera.set_cmf_a; other renderers show it as fixed.

The foveated camera example puts the eye in the viewer's scene-camera slot,
covers the view with the sphere and retina comparison, and steers the gaze by
dragging or with I/J/K/L. The comparison redraws only when the viewer shows a
new eye frame and reuses that frame, so OVRTX sampling noise no longer makes it
flicker in a still scene.
@nblauch
nblauch requested a review from a team November 24, 2026 03:40
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Nov 24, 2026
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are fixed and no new actionable issues were found.

Summary

Adds viewer controls for foveated cameras and runtime foveation changes on supported Newton cameras.

  • Newton viewer panels now steer foveated cameras and change supported foveation.
  • The foveated-camera example lets people steer gaze by dragging and inspect the full retina.

Reviews (2) · Last reviewed commit: "Address review of the viewer gaze and fo..." · Reviewed by Greptile

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

Needs attention: Design and architecture (1), Scope and over-engineering (1), Compatibility and deprecation (1), Implementation (5), Style consistency (5), Test quality (3). Other reviewed categories look good.

  • PR description: Title matches scope; disclose O/U removal, replace “switching back is free” with “avoids retina construction,” and benchmark image-equality viewer latency using revisions, workload, hardware, backend, environment count, warmup, and baseline/head timings.
  • Design and architecture: Collected cameras leave viewer callbacks retaining controls and gaze buffers; detach those callbacks when the camera is collected or closed.
  • Scope and over-engineering: Minimal implementation: Extend FoveatedCamera’s sampling owner and FoveatedNewtonCamera’s ray-storage owner; keep gaze_controls.py for its registration lifecycle and the example for steering and composition; delete per-switch full-ray temporaries in favor of cached padded directions and direct direction-view updates. Scope is cohesive; no split recommended.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: documented O/U retina magnification is removed without functional bindings, targeted warnings, migration guidance, or transition coverage; retain it through a deprecation cycle.
  • Implementation: Repeated slider and button labels share ImGui IDs across cameras, mixing interaction state; scope each camera’s child widgets with a unique ID.
  • Style consistency: New backend capability class variables lack the required ClassVar annotations; annotate both declarations as ClassVar[bool].
  • Test quality: The registration test bypasses camera construction and cannot detect removal of automatic wiring; construct the camera, reset the simulation, and observe attachment and cleanup.

Significant concerns. Posted 16 inline findings.

Automated review; human maintainers own approval decisions.

Comment thread examples/sensors/foveated_camera.py Resolved
@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@matthewtrepte this picks up your idea on #9074 to put the controls in the Newton viewer's side panel. Every FoveatedCamera now adds a section there in any scene, not just the example. Its tilt and pan sliders follow the camera's gaze, so with a gaze action you watch the policy's gaze, and moving one sets it. In place of a magnify slider, a foveation selector changes the retina's cmf_a at runtime over a log-spaced set (viewer_cmf_a_values). That works on Newton for retinas with a fixed sample count; OVRTX and Isaac RTX load their lens once, so they show it as fixed. In the example the eye is now the viewer's main camera, so WASD moves the mount, and dragging on the view or I/J/K/L steers the gaze. O/U magnification is gone.

Give each camera's side-panel widgets their own ImGui ID scope, so two
cameras' sliders no longer share state, and keep the camera's starting
cmf_a as a foveation option after a switch. Release the controls' buffers
when the camera is collected.

Clear the cmf_a retina cache when the camera initializes again, cache the
renderer's rays per value instead of rebuilding them on each switch, and
annotate the backend capability flags as ClassVar.

In the example, redraw the comparison when the gaze or foveation changes
as well as when the eye frame does, and cover the view once the window
exists and again only when the view is resized, so a moved window stays.

Test the RTX refusal without a simulator, run the runtime cmf_a render
case on Newton only, check that building a camera adds its controls, and
check that the sliders follow a gaze set elsewhere.
@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@isaaclab-review-bot review

@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

Needs attention: Scope and over-engineering (1), Compatibility and deprecation (1), Implementation (3), Style consistency (4), Test quality (1). Other reviewed categories look good.

  • PR description: Correct reset-registration and pixel-for-pixel claims; benchmark per-loop device polling and retina-cache memory using reproducible baseline/candidate revisions, commands, hardware, backend, environment count, warmup, latency, and memory metrics.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: Minimal implementation: extend FoveatedCamera for CMF state and registration, FoveatedNewtonCamera for ray writes, and the existing example for steering and comparison; keep the sole added module, gaze_controls.py, for callback lifecycle, but delete duplicate gaze scratch buffers in the controls and example by using camera-owned writable storage. Scope is cohesive; no split recommended.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: documented O/U comparison zoom is removed without a deprecation bridge; retain functional keys during a warned, documented transition with coverage.
  • Implementation: Shared-camera edits invalidate only the originating window, leaving other attached camera views stale while paused; invalidate every affected view.
  • Style consistency: Incomplete annotations obscure the steering callbacks and five-field retina cache; specify concrete parameter, return, and cache-record types.
  • Test quality: Registration coverage calls the helper directly or inventories private callbacks rather than observing automatic controls; consolidate it into a constructed-camera reset test that observes the registered UI.

Significant concerns. Posted 10 inline findings.

Automated review; human maintainers own approval decisions.

imgui.set_tooltip("Smaller cmf_a concentrates the samples at the fixation; larger spreads them evenly.")
if changed and values[index] != current:
camera.set_cmf_a(values[index])
view = getattr(visualizer, "current_image_view", None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Critical · Implementation — Invalidate every affected window

Both control paths change a shared camera but invalidate only the originating window. Other Newton windows can retain stale images while paused; invalidate every attached view displaying that camera.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 03b0d28: the controls keep the windows they are attached to, and a slider, button or foveation change redraws the camera view of every one. The slider test attaches a second window and checks both redraw.

viewer = viewers[0]
tilt = int(viewer.is_key_down("i")) - int(viewer.is_key_down("k"))
pan = int(viewer.is_key_down("j")) - int(viewer.is_key_down("l"))
magnify = int(viewer.is_key_down("o")) - int(viewer.is_key_down("u"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Compatibility — Retain documented O/U zoom

Removing O/U drops documented comparison magnification, which changing foveation does not replace on fixed RTX cameras. Keep the keys functional during a warned, documented deprecation transition and validate both interactions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as is, for the reasons in the earlier thread, plus one more: the O/U keys arrived with #9074, merged a few hours before this PR and in no release, so there is no user to carry through a deprecation. The PR description states the removal.

Comment thread examples/sensors/foveated_camera.py Outdated
return cover


class GazeSteering:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Style Consistency — Keep functions before classes

GazeSteering now precedes main, contrary to the prescribed order of public functions before public classes. Move main above the class; its invocation remains after the definition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved main above GazeSteering in 03b0d28.

Comment thread examples/sensors/foveated_camera.py Outdated
DRAG_DEG_PER_PIXEL = 0.15
GAZE_LIMIT_DEG = 85.0

def __init__(self, camera: FoveatedCamera, visualizers: list):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Style Consistency — Complete steering callback annotations

The new constructor uses a bare list, and its constructor and mouse callbacks omit return annotations. Specify the visualizer element and callback argument and return types.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotated in 03b0d28.

Comment thread examples/sensors/foveated_camera.py Outdated
from pyglet import event

self.press_over_panel = imgui.get_io().want_capture_mouse
if self.press_over_panel and comparison_image_hovered(imgui):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Implementation — Intercept only left presses

The handler consumes every press over the comparison image, although only left drags steer gaze. Right and middle presses lose normal handling; check the button before returning EVENT_HANDLED.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 03b0d28: the press handler returns at once for any button but the left one, so right and middle presses keep their usual handling.

# or foveation changes; re-rendering in between would show OVRTX's frame-to-frame sampling noise as
# jitter.
latest = viewers[0].current_image_view.frame.data
state = (tuple(camera.gaze_angles.torch[0].tolist()), camera.cfg.cmf_a_deg)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Implementation — Avoid per-loop GPU synchronization

Reading gaze with tolist() and comparing the full frame with torch.equal synchronizes and scans device data every loop, including unchanged views. Use change signals instead of device-content polling.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as is. The viewer's image view exposes no frame counter to watch instead, the example's loop already waits on each render, and comparing one small image per loop does not show next to rendering. It is an example, so I'd rather not add plumbing to the viewer for it.

"""Axis signs between OpenGL camera-frame directions (x right, y up, -z forward) and ROS ones (x right, y down)."""


def fixed_count_style(style: str) -> bool:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Style Consistency — Mark internal predicates private

fixed_count_style and runtime_cmf_a_limitation serve only camera and panel internals, but their names advertise a public module API. Prefix both with underscores and update their callers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to _fixed_count_style and _runtime_cmf_a_limitation in 03b0d28.

self._segmentation_neighbors: torch.Tensor | None = None
self._sensor_fov_valid: torch.Tensor | None = None
self._pooler = None
self._retinas: dict[float, tuple] = {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Style Consistency — Type the retina cache record

dict[float, tuple] erases the five-field record unpacked by set_cmf_a. Annotate its coordinate, ray, renderer-ray, and pooler fields so changes to the cache remain checkable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 03b0d28: the cache holds _Retina named tuples with typed fields.

def _set_gaze(self, camera: FoveatedCamera, angles: tuple[float, float], visualizer: BaseVisualizer) -> None:
"""Set ``angles`` [deg] in every environment and redraw the window's camera view, even while paused."""
gaze = camera.gaze_angles.torch
if self._angles is None or self._angles.shape != gaze.shape:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Scope Complexity — Reuse camera-owned gaze storage

The controls and GazeSteering allocate separate angle buffers despite gaze_angles documenting writable storage. Update that buffer in place and pass it to set_gaze_angles; remove the duplicate buffers and copies.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 03b0d28: the controls and the example's steering write into the camera's gaze_angles and pass that buffer to set_gaze_angles, as the gaze action does, so neither keeps its own copy.


def test_every_foveated_camera_adds_its_sliders_on_reset_until_it_is_gone() -> None:
camera = _SliderCamera(num_envs=1)
before = set(SimulationContext._reset_callbacks)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Test Quality — Prove automatic registration at camera boundary

This stand-in calls the helper directly, while the render case inventories private callbacks; neither proves camera construction displays controls. Consolidate them into a constructed-camera reset test observing the registered UI.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this split as is. Observing the drawn UI from a constructed camera needs a Newton viewer window in the test, which CI does not have. Together the two cases cover the chain: building a camera in a scene registers its controls (Newton render case), and the registered callback attaches to Newton windows and draws there (simulator-free case).

Redraw the camera view of every window the controls are in, not only the
one that changed. Write slider and steering changes into the camera's own
gaze buffer instead of separate copies, and let the example's comparison
window keep right and middle presses.

Give the retina cache a typed record, mark the runtime cmf_a helpers
private, put the example's main before its steering class, and annotate
the steering callbacks.
@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Nov 24, 2026
@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@kellyguo11 @matthewtrepte this is ready for review. Greptile has no open findings, and both rounds from the Isaac Lab review bot are addressed in d569921 and 03b0d28, with replies on each thread. Points left for you to weigh, where I pushed back:

  • Keeping the example's O/U zoom keys through a deprecation cycle: they arrived with Add isaaclab_fovi foveated camera sensors and active-gaze camera tasks #9074 a few hours before this PR and were never released, so I removed them.
  • Avoiding the example's per-loop image comparison: the viewer exposes no frame counter to watch instead, and the comparison is small next to rendering.
  • A single test that builds a camera and checks the drawn panel: that needs a Newton viewer window in CI, so two tests cover the chain instead.

With renderer=isaacsim_rtx the example crashed while Kit started: its
top-level imports loaded the pip USD library before launch_simulation
started Kit, whose own USD then failed to load. The example now imports
pxr inside the clutter helper, which runs after launch, and imports the
FoveatedCamera and BaseVisualizer runtime classes, which load USD, only
for type checking, as the microduck-warehouse demo keeps runtime imports
out of module scope.
nblauch added a commit to nblauch/IsaacLab that referenced this pull request Nov 24, 2026
Binocular gaze now stacks on isaac-sim#9182 as well as isaac-sim#9181.
Both added to FoveatedCamera and the render cases at the same places;
the merge keeps both: gaze_writes beside _renders_switchable_rays,
mount_pos_w and update_mount beside supports_runtime_cmf_a, and the
hybrid and binocular cases before the runtime cmf_a case.
The example crashed on main with renderer=isaacsim_rtx; a119576 fixed it
without a changelog entry. The entry goes in isaaclab's changelog, where
the example was added.
…ig keys

FoveatedCameraCfg carried two viewer settings: viewer_gaze_controls, which
only kept the example's helper overview camera out of the side panel, and
viewer_cmf_a_values, the foveation slider's stops. Both are gone.

A Newton window now draws a camera's controls while its camera view shows
that camera, so a camera the viewer cannot show, such as the overview, has
none, and switching cameras in the window's menu switches the controls.
The stops are ViewerGazeControls.cmf_a_values, now 0.001 to 1000 degrees in
decades, which the sliders read as they draw, with each camera's starting
cmf_a added. ViewerGazeControls is exported and documented for that.

The foveated-camera example sets the stops with --cmf_a_values, comma
separated so that the overrides after it stay overrides.
@matthewtrepte

Copy link
Copy Markdown
Collaborator

@nblauch if you have time, do you mind sharing a quick video or screenshot of what the controls look like?

@matthewtrepte

Copy link
Copy Markdown
Collaborator

are the foveated viewer controls specific to this example script?

ideally, the way it would work, is if the user in the newton visualizer, selects a foveated camera as their source camera, than these foveated controls get exposed. i think can they live next to the "focal length" slider.

@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@nblauch if you have time, do you mind sharing a quick video or screenshot of what the controls look like?

Screencast.from.2026-11-24.13-55-55.webm

@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

are the foveated viewer controls specific to this example script?

They're not specific to the example: every FoveatedCamera registers them when it's built, in any scene, with no task code. As of 44eceea they also work the way you describe: a Newton window draws a camera's controls only while that camera is its selected source, so choosing a foveated camera in "Camera Source" brings up its gaze sliders and foveation selector, and choosing anything else hides them. That commit also took the two viewer settings out of FoveatedCameraCfg.

The placement is the one difference. From outside the visualizer, a sensor can only add controls through register_ui_callback, and the side slot draws them as their own "Foveated camera: " section under the Simulation header. The rendering slot would sit nearer Focal Length, but it's inside the collapsed Lighting & Appearance tree and isn't drawn in RTX mode. Putting them under "Camera Sensor", below the source menu, would need a small hook in isaaclab_visualizers, e.g. _draw_sensor_controls calling a draw method the selected sensor provides. I've kept this PR out of isaaclab_visualizers so far, but I'm happy to add that hook, here or in a small follow-up, if you'd like it there.

The video is in the comment above.

The Newton visualizer let other code add controls only through its
register_ui_callback slots, so the foveated camera's gaze and foveation
controls sat in their own section under the Simulation header.

NewtonVisualizerBase.register_sensor_ui_callback adds a generic hook:
while a scene sensor is a window's camera source, each callback draws in
the Camera Sensor section, after its channel and environment controls,
with that sensor. The environment controls move to _draw_sensor_envs so
that their early return for a single-environment sensor does not skip the
callbacks. Foveated cameras register through it and draw a "Foveated
Camera" group when the sensor is theirs.
The comparison window's header titled its two images "Viewing sphere" and
"Retina" and showed the CMF constant, which the foveation slider below the
Camera Source selector already shows; the right image is also the
cortical view rather than the retina. The window now shows the two images
side by side, and the example no longer needs PIL or NumPy.
…and example

The docs page and the foveated-camera example still placed the gaze and
foveation sliders in the side panel at large and called the camera's image
the retina. The Sampling section now names the published lattice image
the retina's cortical view, and the example's description, help text and
docstrings use that name and place the sliders below the Camera Source
selector, in the Camera Sensor section.
The cortical view belongs to the foveated camera, not to its retina; the
docs page and the foveated-camera example now say so.
@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Both nits are addressed:

  • Controls under Camera Source (8164e3d). When a foveated camera is the selected Camera Source, its gaze and foveation controls now appear right below the selector, in the Camera Sensor section, and the separate section under Simulation is gone. This needed a small hook in isaaclab_visualizers: NewtonVisualizerBase.register_sensor_ui_callback(callback). While a scene sensor is the camera source, it calls each callback with imgui and that sensor, at the end of the Camera Sensor section. Nothing in it is foveated-specific: foveated cameras register through it and draw only when the sensor is theirs, and any other sensor type could use it the same way.
  • Duplicate value in the top right (a602a4a). I took this to be the cmf_a readout in the right corner of the comparison window's header, which repeated the foveation slider's value. The header is gone altogether, along with its "Viewing sphere" and "Retina" titles, so the window just shows the two images. If you meant a different value, let me know.

f8ae4e5 and 656523b update the docs page and the example's description to match.

The comparison composes the foveated camera's output image, which is in
cortical space; the retina is the sampling space it comes from.
@nblauch

nblauch commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Nov 24, 2026
@kellyguo11
kellyguo11 enabled auto-merge (squash) November 24, 2026 23:55
@kellyguo11
kellyguo11 merged commit 4653f04 into isaac-sim:main Nov 25, 2026
95 of 129 checks passed
@nblauch
nblauch deleted the feat/isaaclab-fovi-viewer-controls branch November 25, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants