Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ The following modules are available in the ``isaaclab_fovi`` extension:
.. autosummary::
:toctree: lab_fovi

assets
mdp
sensors

Expand Down
24 changes: 24 additions & 0 deletions docs/source/api/lab_fovi/isaaclab_fovi.assets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
isaaclab_fovi.assets
====================

.. automodule:: isaaclab_fovi.assets

.. rubric:: Data

.. autosummary::

PAN_TILT_CFG
PAN_TILT_CAMERA_OFFSET
PAN_TILT_USD_PATH

Pan-tilt mount
--------------

.. autodata:: PAN_TILT_CFG
:no-value:

.. autodata:: PAN_TILT_CAMERA_OFFSET
:no-value:

.. autodata:: PAN_TILT_USD_PATH
:no-value:
6 changes: 6 additions & 0 deletions docs/source/api/lab_fovi/isaaclab_fovi.mdp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ isaaclab_fovi.mdp

GazeAction
GazeActionCfg
GazeRigCfg
gaze_teacher_labels

.. rubric:: Functions
Expand All @@ -30,6 +31,11 @@ Actions
:show-inheritance:
:exclude-members: __init__, class_type

.. autoclass:: GazeRigCfg
:members:
:show-inheritance:
:exclude-members: __init__

Observations
------------

Expand Down
41 changes: 41 additions & 0 deletions docs/source/experimental-features/foveated_camera.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,44 @@ Select ``presets=depth`` for depth images.

For other manager-based tasks, use :class:`~mdp.GazeActionCfg` to move gaze, :func:`~mdp.gaze_state` to
observe it, and :class:`~mdp.gaze_teacher_labels` for optional supervision.

Gaze modes
----------

:attr:`~mdp.GazeActionCfg.mode` sets what the gaze actions turn, two (tilt, pan) actions in every mode but dual gaze:

* ``"software"`` (the default): the retina, relative to the camera's optical axis. The camera itself may move, for
example on a robot's head, with ``mount="tracked"``.
* ``"physical"``: the joints of a rig that carries the camera. Each action steps the joint targets.
* ``"hybrid"``: the retina at once, while the rig turns the camera after it by at most
:attr:`~mdp.GazeRigCfg.max_step_deg` per step. The fixation holds in the world as the head takes over, so the
camera ends up pointing where it looks.
* ``"dual"`` (experimental): four actions that move the rig's joints and then the retina independently.

The rig modes need a :class:`~mdp.GazeRigCfg`, which names the articulation and its pan and tilt joints,
``mount="tracked"``, and a camera without image roll. :data:`~assets.PAN_TILT_CFG` is a two-joint
pan-tilt mount:

.. code-block:: python

from isaaclab.sim import PinholeCameraCfg
from isaaclab_fovi.assets import PAN_TILT_CAMERA_OFFSET, PAN_TILT_CFG
from isaaclab_fovi.mdp import GazeActionCfg, GazeRigCfg
from isaaclab_fovi.sensors import FoveatedCameraCfg

rig = PAN_TILT_CFG
eye = FoveatedCameraCfg(
prim_path="{ENV_REGEX_NS}/PanTilt/Geometry/world/pan_link/tilt_link/Eye",
offset=PAN_TILT_CAMERA_OFFSET,
spawn=PinholeCameraCfg(),
)
gaze = GazeActionCfg(asset_name="eye", mode="hybrid", mount="tracked", rig=GazeRigCfg(asset_name="rig"))

With a rig, :func:`~mdp.gaze_state` reports the fixation's direction from the rig's zero pose: the head's turn
composed with the software gaze.

.. figure:: ../_static/overview/sensors/foveated_camera_gaze_modes.jpg
:alt: Pan angles over time for the four gaze modes, with the camera's images before, during and after.

Each mode on the pan-tilt mount with Newton's MJWarp solver: 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.
9 changes: 9 additions & 0 deletions source/isaaclab_fovi/changelog.d/fovi-gaze-modes.added.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* Added physical, hybrid and dual (experimental) gaze to :class:`~isaaclab_fovi.mdp.GazeActionCfg` through its
``mode`` and :class:`~isaaclab_fovi.mdp.GazeRigCfg`: the gaze actions turn a rig's joints, the retina while the
rig follows, or both independently.
* Added :data:`~isaaclab_fovi.assets.PAN_TILT_CFG`, a two-joint pan-tilt mount for a camera.
* Added :meth:`~isaaclab_fovi.sensors.FoveatedCamera.update_mount`, which reads the camera's mount before a lazily
updated camera renders; hybrid gaze and the tracked-mount teacher aim from it.
* Added :attr:`~isaaclab_fovi.sensors.FoveatedCamera.gaze_writes`, which counts
:meth:`~isaaclab_fovi.sensors.FoveatedCamera.set_gaze_angles` calls, so hybrid gaze starts a new fixation after a
gaze set from elsewhere.
9 changes: 9 additions & 0 deletions source/isaaclab_fovi/changelog.d/fovi-gaze-modes.fixed.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* Fixed :class:`~isaaclab_fovi.mdp.gaze_teacher_labels` rendering a frame for every label, also between the frames
a policy observes: it read the camera's position from its data, which updates the image. It now reads
:attr:`~isaaclab_fovi.sensors.FoveatedCamera.mount_pos_w`, which
:meth:`~isaaclab_fovi.sensors.FoveatedCamera.update_mount` refreshes.
* Fixed the gaze teacher of a tracked mount aiming from the mount of the step before: a lazily updated camera
records its mount only when its data is read. The teacher now reads it with
:meth:`~isaaclab_fovi.sensors.FoveatedCamera.update_mount`.
* Fixed :class:`~isaaclab_fovi.mdp.gaze_teacher_labels` raising a ``TypeError`` when its target names every body
of the asset, as naming a rigid object's only body does, which resolves the body ids to a slice.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Added ``target_w`` to :class:`~isaaclab_fovi.mdp.gaze_teacher_labels`: a function of the environment that returns
each environment's target point in the world, for a target that is not fixed to one asset, such as the object a
command picks among several.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Added tracked gaze mounts on Isaac RTX: :meth:`~isaaclab_fovi.sensors.FoveatedCamera.update_mount` now reads the
mount of a camera that holds its gaze in its prim, so :class:`~isaaclab_fovi.mdp.GazeActionCfg` takes
``mount="tracked"``, and with it the physical, hybrid and dual gaze modes, with every renderer.
Empty file.
10 changes: 10 additions & 0 deletions source/isaaclab_fovi/isaaclab_fovi/assets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""Assets for physical gaze: a pan-tilt camera mount."""

from isaaclab.utils.module import lazy_export

lazy_export()
12 changes: 12 additions & 0 deletions source/isaaclab_fovi/isaaclab_fovi/assets/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

__all__ = [
"PAN_TILT_CAMERA_OFFSET",
"PAN_TILT_CFG",
"PAN_TILT_USD_PATH",
]

from .pan_tilt import PAN_TILT_CAMERA_OFFSET, PAN_TILT_CFG, PAN_TILT_USD_PATH
49 changes: 49 additions & 0 deletions source/isaaclab_fovi/isaaclab_fovi/assets/pan_tilt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""A two-joint pan-tilt mount that turns a camera, for physical and hybrid gaze.

The mount stands on a fixed base. ``pan_joint`` turns about the base's +Z axis (positive turns left) and
``tilt_joint`` about the panned +X axis (positive turns up). At zero the mount faces +Y; a camera prim under
``tilt_link`` at :data:`PAN_TILT_CAMERA_OFFSET` looks along it with +Z up. The asset has no visual geometry.
"""

from __future__ import annotations

from pathlib import Path

import isaaclab.sim as sim_utils
from isaaclab.actuators import ImplicitActuatorCfg
from isaaclab.assets.articulation import ArticulationCfg
from isaaclab.sensors import CameraCfg

PAN_TILT_USD_PATH = str(Path(__file__).with_name("pan_tilt.usda"))
"""The mount's USD, converted from its URDF with fixed joints merged; it loads with or without Kit."""

PAN_TILT_CAMERA_OFFSET = CameraCfg.OffsetCfg(
pos=(0.0, 0.0, 0.0), rot=(0.0, 0.0, 0.70710678, 0.70710678), convention="world"
)
"""Pose of a camera under ``tilt_link`` that looks along the mount's forward axis (world convention)."""

PAN_TILT_CFG = ArticulationCfg(
prim_path="{ENV_REGEX_NS}/PanTilt",
# Gravity stays on: Newton reads a body's disable-gravity flag as the whole scene's.
spawn=sim_utils.UsdFileCfg(usd_path=PAN_TILT_USD_PATH, fix_root_link=True),
init_state=ArticulationCfg.InitialStateCfg(joint_pos={"pan_joint": 0.0, "tilt_joint": 0.0}),
actuators={
"pan_tilt": ImplicitActuatorCfg(
joint_names_expr=["pan_joint", "tilt_joint"],
stiffness=10.0,
damping=1.4,
joint_effort_limit=20.0,
armature=0.05,
)
},
soft_joint_pos_limit_factor=1.0,
)
"""The pan-tilt mount: about critically damped position drives that settle in about 0.3 s.

The armature carries the drives' inertia: the links themselves are too light for a stable stiff drive at Isaac Lab's
usual physics step."""
3 changes: 3 additions & 0 deletions source/isaaclab_fovi/isaaclab_fovi/assets/pan_tilt.usda
Git LFS file not shown
3 changes: 2 additions & 1 deletion source/isaaclab_fovi/isaaclab_fovi/mdp/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
__all__ = [
"GazeAction",
"GazeActionCfg",
"GazeRigCfg",
"gaze_state",
"gaze_teacher_labels",
]
Expand All @@ -15,4 +16,4 @@ from .gaze import (
gaze_state,
gaze_teacher_labels,
)
from .gaze_cfg import GazeActionCfg
from .gaze_cfg import GazeActionCfg, GazeRigCfg
Loading