isaaclab_fovi.sensors#
Foveated camera sensors.
Names are imported on first access, so reading the configuration does not load a renderer runtime.
Classes
Camera that samples the scene on a foveated retina instead of a uniform pixel grid. |
|
Configuration for a foveated camera, whose retina samples densely where it looks and sparsely in the periphery. |
|
Newton camera that renders with foveated (CMF-distributed) rays. |
|
RTX camera that renders with foveated (CMF-distributed) rays. |
|
Gaze and foveation controls for one foveated camera, in the Camera Sensor section of each Newton viewer window, below its Camera Source selector. |
Foveated Camera#
- class isaaclab_fovi.sensors.FoveatedCamera[source]#
Bases:
CameraCamera that samples the scene on a foveated retina instead of a uniform pixel grid.
The sample layout comes from
fovi.sensing.coords.SamplingCoords. Constructing this class returns the implementation for the renderer selected byFoveatedCameraCfg.renderer_cfg:newton_warpandnewton_optix:FoveatedNewtonCamera, which injects the foveated rays into Newton’s renderer.isaac_rtxandovrtx:FoveatedRTXCamera, which authors a lens lookup table on the camera prim.
Both are subclasses of this class and are imported on first use, so selecting one renderer does not load the other’s runtime.
The gaze turns the retina relative to the optical axis of the physical camera it looks through. Newton and OVRTX turn the rendered camera pose by the gaze in each pose update; Isaac RTX writes the turned pose into the camera prims, which Replicator reads.
Attributes:
The configuration parameters.
How many times
set_world_poses()orset_world_poses_from_view()has turned the camera's mount.the retina's grid, or (num_samples, 1) for sample sets.
The
SamplingCoordsof the published samples.Number of published foveated samples.
Per-environment fraction of samples inside the physical camera, or None before the first masked frame.
The physical camera the retina looks through, as resolved at initialization.
camera_modelas a Warp struct, for kernels that project camera-frame directions.Rotation from the upright image frame, in which gazes are measured, to the physical camera's frame (ROS convention); it undoes
cfg.image_rotation_deg.Whether each pose update turns the rendered pose by the stored gaze (Newton and OVRTX).
The camera's stored gaze angles [deg], shape (num_envs,) of
vec2f(Torch view (num_envs, 2)).World orientation (x, y, z, w) of the physical camera before the gaze turns it, ROS convention, shape (num_envs,) of
quatf.on Newton, for retinas whose sample count does not depend on the CMF constant (the warped-Cartesian and
_fixnisotropic styles).Methods:
__new__(cls, cfg, *args, **kwargs)Create the implementation that matches the configured renderer.
__init__(cfg, *[, turns_pose_by_gaze])Create the camera.
set_gaze_angles(angles_deg)Turn the retina to (tilt, pan) [deg] from the physical camera's optical axis.
World orientation (x, y, z, w) of the physical camera now, before the gaze turns it, ROS convention, shape (num_envs, 4).
set_world_poses([positions, orientations, ...])Move the camera's mount; the gaze stays relative to the new mount.
set_world_poses_from_view(eyes, targets[, ...])Point the camera's mount from
eyesattargets; the gaze stays relative to the new mount.set_intrinsic_matrices(matrices[, ...])Keep the camera as configured and warn the caller.
set_cmf_a(cmf_a_deg)Re-sample the retina for a new CMF constant [deg], keeping the gaze, the sample count and every buffer.
- cfg: FoveatedCameraCfg#
The configuration parameters.
- static __new__(cls, cfg: FoveatedCameraCfg, *args, **kwargs)[source]#
Create the implementation that matches the configured renderer.
- Parameters:
cfg¶ – Camera configuration with a concrete renderer configuration.
- Raises:
ValueError – The configured renderer has no foveated implementation.
- __init__(cfg: FoveatedCameraCfg, *, turns_pose_by_gaze: bool = False)[source]#
Create the camera.
- Raises:
ValueError – A Newton or OVRTX camera without
update_latest_camera_pose, whose renderer would never see the gaze.
- mount_turns#
How many times
set_world_poses()orset_world_poses_from_view()has turned the camera’s mount.
- property image_shape: tuple[int, int][source]#
the retina’s grid, or (num_samples, 1) for sample sets.
- Type:
(height, width) of the published outputs
- property sensor_fov_valid_fraction: Tensor | None[source]#
Per-environment fraction of samples inside the physical camera, or None before the first masked frame.
- property camera_model: fovi.sensing.projection.CameraModel[source]#
The physical camera the retina looks through, as resolved at initialization.
- property projection_params: CameraParams[source]#
camera_modelas a Warp struct, for kernels that project camera-frame directions.
- property image_frame: mat33f[source]#
Rotation from the upright image frame, in which gazes are measured, to the physical camera’s frame (ROS convention); it undoes
cfg.image_rotation_deg.
- property turns_pose_by_gaze: bool[source]#
Whether each pose update turns the rendered pose by the stored gaze (Newton and OVRTX). A writer of
gaze_anglesthen needs no other launch.
- property gaze_angles: ProxyArray[source]#
The camera’s stored gaze angles [deg], shape (num_envs,) of
vec2f(Torch view (num_envs, 2)).A writer that moves the gaze every step can update this buffer in place and pass its Torch view to
set_gaze_angles(), which then copies nothing. Writes take effect whenset_gaze_angles()is called.
- property mount_quat_w_ros: ProxyArray[source]#
World orientation (x, y, z, w) of the physical camera before the gaze turns it, ROS convention, shape (num_envs,) of
quatf.Refreshed by each pose update that turns the gaze, so it follows a mount that moves, for example a camera on a robot’s head. Only cameras whose pose update turns the gaze (Newton and OVRTX) record it.
- property supports_runtime_cmf_a: bool[source]#
on Newton, for retinas whose sample count does not depend on the CMF constant (the warped-Cartesian and
_fixnisotropic styles).- Type:
Whether
set_cmf_a()can change this camera’s foveation while it runs
- set_gaze_angles(angles_deg: Tensor) None[source]#
Turn the retina to (tilt, pan) [deg] from the physical camera’s optical axis.
Positive tilt looks up and positive pan looks left. Zero looks along the optical axis.
- Parameters:
angles_deg¶ – Gaze angles for every environment [deg], shape (num_envs, 2).
- Raises:
ValueError – The angles do not hold one row per camera.
- ungazed_quat_w_ros() Tensor[source]#
World orientation (x, y, z, w) of the physical camera now, before the gaze turns it, ROS convention, shape (num_envs, 4).
- set_world_poses(positions=None, orientations=None, env_ids=None, convention='ros')[source]#
Move the camera’s mount; the gaze stays relative to the new mount.
Args are those of
isaaclab.sensors.Camera.set_world_poses().
- set_world_poses_from_view(eyes, targets, env_ids=None)[source]#
Point the camera’s mount from
eyesattargets; the gaze stays relative to the new mount.Args are those of
isaaclab.sensors.Camera.set_world_poses_from_view().
- set_intrinsic_matrices(matrices, focal_length=None, env_ids=None)[source]#
Keep the camera as configured and warn the caller.
A foveated camera’s projection comes from its retina and
camera_model, which pinhole intrinsics cannot describe, so this call changes nothing: the rendered rays and the reported intrinsic matrices stay as configured. Stock cameras with an OpenCV lens model handle the call the same way. To change the projection, configurecamera_model(orspawn) andcmf_a_deg.Args are those of
isaaclab.sensors.Camera.set_intrinsic_matrices().
- set_cmf_a(cmf_a_deg: float) None[source]#
Re-sample the retina for a new CMF constant [deg], keeping the gaze, the sample count and every buffer.
Each constant’s retina is built once and cached until the camera is initialized again, so switching back to one reuses it.
- Raises:
RuntimeError – The camera is not initialized.
NotImplementedError – The renderer or sampling style cannot change the retina at runtime; see
supports_runtime_cmf_a.
- class isaaclab_fovi.sensors.FoveatedCameraCfg[source]#
Bases:
CameraCfgConfiguration for a foveated camera, whose retina samples densely where it looks and sparsely in the periphery.
See Foveated Camera for how each setting shapes the retina.
Attributes:
smaller foveates more strongly; the default is an estimate from human vision.
The physical camera as
CameraModelfields; None uses the camera thatspawncreates.Grid side of the retina; isotropic retinas use as many rings as keep at most its square of samples.
the default grid publishes an upright image; sample-set styles publish a list of samples.
"circular","square"or"wang".2.0 for circular shells, infinity for square ones.
"v1like","schwartz"or"warp".Counter-clockwise roll [deg] of the rays about the optical axis that undoes a rolled mount.
Zero the samples outside the physical camera's image at the current gaze.
Diameter of the retinal window as a fraction of the reference image side.
shortorlong.Cloning contexts for this sensor.
Prim path (or expression) to the sensor.
Update period of the sensor buffers (in seconds).
Whether to visualize the sensor.
The offset pose of the sensor's frame from the sensor's parent frame.
Spawn configuration for the asset.
Clipping behavior for the camera for values exceed the maximum value.
Whether the camera renders only when its data is read, even when the scene updates its sensors eagerly.
List of sensor names/types to enable for the camera.
Per-camera OVRTX render-product attributes, as
{name: (USD type name, value)}.A string or a list specifying a semantic filter predicate.
Whether to colorize the semantic segmentation images.
Whether to colorize the instance ID segmentation images.
Whether to colorize the instance ID segmentation images.
Dictionary mapping semantics to specific colours
Background color for the camera as normalized RGB floats
(red, green, blue)in[0, 1].Renderer configuration for camera sensor.
PPISP coefficients or discovery mode.
Processors that compute camera outputs from render outputs, run in order after each capture.
Camera exposure, authored on the camera prims before the scene is cloned.
Render a denser photoreceptor grid and pool it to the retina.
How many times denser the photoreceptor grid is than the retina; an integer for grid styles.
a square window's area for grid styles, else nearest neighbours.
"avg","gaussian","max", or"sum"for sample sets."geodesic"on the cortex,Truecortical,Falsevisual.Gaussian sigma for
pool_mode="gaussian"."modal", each sample's most common label among its neighbours.Side of the RTX inverse lens texture; None uses
max(128, 4 * grid side).Width of the image in pixels.
Height of the image in pixels.
their pose update applies the gaze.
Classes:
The offset pose of the sensor's frame from the sensor's parent frame.
Methods:
Validate the processors and the requested data types against the selected renderer contract.
- cmf_a_deg: float#
smaller foveates more strongly; the default is an estimate from human vision.
- Type:
CMF constant a [deg]
- camera_model: CameraCalibration | None#
The physical camera as
CameraModelfields; None uses the camera thatspawncreates.
- foveated_res: int#
Grid side of the retina; isotropic retinas use as many rings as keep at most its square of samples.
- foveated_style: str#
the default grid publishes an upright image; sample-set styles publish a list of samples.
- Type:
Sampling style
- radius_norm: float#
2.0 for circular shells, infinity for square ones.
- Type:
Norm of the warped-Cartesian sampling shells
- isotropic_plotting_type: str#
"v1like","schwartz"or"warp".- Type:
Cortical layout of an isotropic retina’s samples
- image_rotation_deg: float#
Counter-clockwise roll [deg] of the rays about the optical axis that undoes a rolled mount.
- retinal_window_fraction: float#
Diameter of the retinal window as a fraction of the reference image side.
- retinal_window_reference_side: str#
shortorlong.- Type:
Image side defining the retinal window diameter
- class OffsetCfg[source]#
Bases:
objectThe offset pose of the sensor’s frame from the sensor’s parent frame.
Attributes:
Translation w.r.t.
Quaternion rotation (x, y, z, w) w.r.t.
The convention in which the frame offset is applied.
- rot: tuple[float, float, float, float]#
Quaternion rotation (x, y, z, w) w.r.t. the parent frame. Defaults to (0.0, 0.0, 0.0, 1.0).
- convention: Literal['opengl', 'ros', 'world']#
The convention in which the frame offset is applied. Defaults to “ros”.
"opengl"- forward axis:-Z- up axis:+Y- Offset is applied in the OpenGL (Usd.Camera) convention."ros"- forward axis:+Z- up axis:-Y- Offset is applied in the ROS convention."world"- forward axis:+X- up axis:+Z- Offset is applied in the World Frame convention.
- validate_config() None[source]#
Validate the processors and the requested data types against the selected renderer contract.
- cloning_contexts: tuple[type[ReplicateContext] | str, ...] | None#
Cloning contexts for this sensor. Defaults to no explicit cloning context.
Sensors carry no physics of their own. When the sensor has a spawner, USD replication is added automatically under Kit. Listing
UsdReplicateContextexplicitly forces USD replication without Kit; seecloning_contexts.
- prim_path: str#
Prim path (or expression) to the sensor.
Note
The expression can contain the environment namespace regex
{ENV_REGEX_NS}which will be replaced with the environment namespace.Example:
{ENV_REGEX_NS}/Robot/sensorwill be replaced with/World/envs/env_[^/]+/Robot/sensor.
- update_period: float#
Update period of the sensor buffers (in seconds). Defaults to 0.0 (update every step).
- offset: OffsetCfg#
The offset pose of the sensor’s frame from the sensor’s parent frame. Defaults to identity.
Note
The parent frame is the frame the sensor attaches to. For example, the parent frame of a camera at path
/World/envs/env_0/Robot/Camerais/World/envs/env_0/Robot.
- spawn: PinholeCameraCfg | FisheyeCameraCfg | None#
Spawn configuration for the asset.
If None, then the prim is not spawned by the asset. Instead, it is assumed that the asset is already present in the scene.
- depth_clipping_behavior: Literal['max', 'zero', 'none']#
Clipping behavior for the camera for values exceed the maximum value. Defaults to “none”.
"max": Values are clipped to the maximum value."zero": Values are clipped to zero."none: No clipping is applied. Values will be returned asinf.
Deprecated since version 4.6.22: This field is RTX-specific. Set
depth_clipping_behavioronrenderer_cfginstead.
- render_on_demand: bool#
Whether the camera renders only when its data is read, even when the scene updates its sensors eagerly.
Defaults to False. A visualizer’s viewer camera sets it, so that it renders only while its view is shown.
- data_types: list[str]#
List of sensor names/types to enable for the camera. Defaults to [“rgb”].
Please refer to the
Cameraclass for a list of available data types.
- render_settings: dict[str, tuple[str, Any]]#
Per-camera OVRTX render-product attributes, as
{name: (USD type name, value)}.For example,
{"omni:rtx:quality": ("Int", 0)}disables the path tracer convergence loop for an interactive camera. These settings do not change the shared renderer configuration.
- semantic_filter: str | list[str]#
A string or a list specifying a semantic filter predicate. Defaults to
"*:*".If a string, it should be a disjunctive normal form of (semantic type, labels). For examples:
"typeA : labelA & !labelB | labelC , typeB: labelA ; typeC: labelE": All prims with semantic type “typeA” and label “labelA” but not “labelB” or with label “labelC”. Also, all prims with semantic type “typeB” and label “labelA”, or with semantic type “typeC” and label “labelE”."typeA : * ; * : labelA": All prims with semantic type “typeA” or with label “labelA”
If a list of strings, each string should be a semantic type. The segmentation for prims with semantics of the specified types will be retrieved. For example, if the list is [“class”], only the segmentation for prims with semantics of type “class” will be retrieved.
See also
For more information on the semantics filter, see the documentation on Replicator Semantics Schema Editor.
Deprecated since version 4.6.22: This field is RTX-specific. Set
semantic_filteronrenderer_cfginstead.
- colorize_semantic_segmentation: bool#
Whether to colorize the semantic segmentation images. Defaults to True.
If True, semantic segmentation is converted to an image where semantic IDs are mapped to colors and returned as a
uint84-channel array. If False, the output is returned as aint32array.Deprecated since version 4.6.22: This field is RTX-specific. Set
colorize_semantic_segmentationonrenderer_cfginstead.
- colorize_instance_id_segmentation: bool#
Whether to colorize the instance ID segmentation images. Defaults to True.
If True, instance id segmentation is converted to an image where instance IDs are mapped to colors. and returned as a
uint84-channel array. If False, the output is returned as aint32array.Deprecated since version 4.6.22: This field is RTX-specific. Set
colorize_instance_id_segmentationonrenderer_cfginstead.
- colorize_instance_segmentation: bool#
Whether to colorize the instance ID segmentation images. Defaults to True.
If True, instance segmentation is converted to an image where instance IDs are mapped to colors. and returned as a
uint84-channel array. If False, the output is returned as aint32array.Deprecated since version 4.6.22: This field is RTX-specific. Set
colorize_instance_segmentationonrenderer_cfginstead.
- semantic_segmentation_mapping: dict#
Dictionary mapping semantics to specific colours
Eg.
{ "class:cube_1": (255, 36, 66, 255), "class:cube_2": (255, 184, 48, 255), "class:cube_3": (55, 255, 139, 255), "class:table": (255, 237, 218, 255), "class:ground": (100, 100, 100, 255), "class:robot": (61, 178, 255, 255), }
Deprecated since version 4.6.22: This field is RTX-specific. Set
semantic_segmentation_mappingonrenderer_cfginstead.
- background_color: tuple[float, float, float] | None#
Background color for the camera as normalized RGB floats
(red, green, blue)in[0, 1].When set, pixels that miss all geometry are filled with this solid color. When
None(the default), each backend uses its own default background.
- renderer_cfg: RendererCfg#
Renderer configuration for camera sensor.
- isp_cfg: Any | CameraISPMode | None#
PPISP coefficients or discovery mode. Defaults to None (no PPISP).
Deprecated since version 3.2: Add
isaaclab_ppisp.PpispProcessorCfg(isp_cfg=...)totensor_processorsinstead. Camera construction moves a non-None value there with aFutureWarning.
- tensor_processors: list[TensorProcessorCfg]#
Processors that compute camera outputs from render outputs, run in order after each capture. Defaults to an empty list.
Each
funcis aTensorProcessorclass. See the camera sensor documentation for inputs, outputs,env_mask, asynchronous rendering, andprepare_camera.
- exposure: ExposureCfg#
Camera exposure, authored on the camera prims before the scene is cloned. Defaults to the renderer’s exposure.
- pool_res_mult: float#
How many times denser the photoreceptor grid is than the retina; an integer for grid styles.
- pool_k: int | None#
a square window’s area for grid styles, else nearest neighbours.
- Type:
Photoreceptors each sample pools
- pool_mode: str#
"avg","gaussian","max", or"sum"for sample sets.- Type:
Pooling of non-segmentation outputs
- pool_sample_cortex: bool | str#
"geodesic"on the cortex,Truecortical,Falsevisual.- Type:
Neighbour distance for sample sets
- pool_int_mode: str#
"modal", each sample’s most common label among its neighbours.- Type:
Pooling of segmentation outputs
Renderer Implementations#
Constructing FoveatedCamera returns one of the following implementations, selected by the renderer in
FoveatedCameraCfg.renderer_cfg.
- class isaaclab_fovi.sensors.FoveatedNewtonCamera[source]#
Bases:
FoveatedCameraNewton camera that renders with foveated (CMF-distributed) rays.
Instead of a uniform pixel grid, this sensor shoots N rays whose directions are derived from
fovi.sensing.coords.SamplingCoordsand injected into Newton’s renderer, with Warp or OptiX traversal. Vector sensors publish(B, N, 1, C); native grid sensors publish upright(B, H, W, C).The samples cover the retinal window of the physical camera; the gaze turns the rendered camera pose.
Attributes:
The configuration parameters.
Methods:
__init__(cfg)Create the camera.
- cfg: FoveatedCameraCfg#
The configuration parameters.
- __init__(cfg: FoveatedCameraCfg)[source]#
Create the camera.
- Raises:
ValueError – A Newton or OVRTX camera without
update_latest_camera_pose, whose renderer would never see the gaze.
- class isaaclab_fovi.sensors.FoveatedRTXCamera[source]#
Bases:
FoveatedCameraRTX camera that renders with foveated (CMF-distributed) rays.
Instead of Newton’s Warp ray arrays, this sensor creates
OmniLensDistortionLutAPICamera prims with LUT textures that define per-texel ray directions. The RTX path tracer renders a 2D texture which is then sampled at pre-computed UV positions to extract per-sample values, producing(B, N, 1, C)output buffers.Grid styles render straight into their native grid. Sample-set styles are packed onto a cortical disc, which keeps neighbouring samples adjacent for DLSS denoising. Camera motion comes from the prim’s parent and from the gaze.
Methods:
__init__(cfg)Create the camera.
set_gaze_angles(angles_deg)Turn the retina to (tilt, pan) [deg] from the physical camera's optical axis.
get_world_poses([env_ids, convention])Read the cameras' mount poses, without the gaze, as every foveated camera reports them.
Mask and publish the frame of the environments that scalar or batched rendering updated.
Attributes:
The configuration parameters.
Whether captures can use the shared camera batch implementation.
- __init__(cfg: FoveatedCameraCfg)[source]#
Create the camera.
- Raises:
ValueError – A Newton or OVRTX camera without
update_latest_camera_pose, whose renderer would never see the gaze.
- cfg: FoveatedCameraCfg#
The configuration parameters.
- property supports_batch_update: bool[source]#
Whether captures can use the shared camera batch implementation.
Custom scalar capture hooks retain their individual update path. Subclasses may opt in explicitly when they also provide a compatible
_update_buffers_batch_impl.
- set_gaze_angles(angles_deg: Tensor) None[source]#
Turn the retina to (tilt, pan) [deg] from the physical camera’s optical axis.
Positive tilt looks up and positive pan looks left. Zero looks along the optical axis.
- Parameters:
angles_deg¶ – Gaze angles for every environment [deg], shape (num_envs, 2).
- Raises:
ValueError – The angles do not hold one row per camera.
- get_world_poses(env_ids=None, convention='ros')[source]#
Read the cameras’ mount poses, without the gaze, as every foveated camera reports them.
Isaac RTX holds the gaze in the camera prims, so it is taken back out; passing the result to
set_world_poses()keeps the mount and the gaze as they are.Args and returns are those of
isaaclab.sensors.Camera.get_world_poses().
Viewer Controls#
Each foveated camera adds these controls to every Newton viewer window, below the Camera Source selector while it is the window’s camera source.
- class isaaclab_fovi.sensors.ViewerGazeControls[source]#
Gaze and foveation controls for one foveated camera, in the Camera Sensor section of each Newton viewer window, below its Camera Source selector.
A window draws the controls while the camera is its camera source, so a camera the viewer cannot show, or another camera chosen in the window’s camera menu, has none. The tilt and pan sliders show the first environment’s gaze every frame, so they follow whatever sets it, such as a gaze action or a drag in the viewer. Moving one sets that gaze in every environment; a gaze action that sets the gaze every step overrides them. The foveation slider steps through
cmf_a_valuesand the camera’s starting CMF constant whereFoveatedCamera.set_cmf_a()can change the retina, and otherwise shows the CMF constant and why it is fixed. A change in any window redraws the camera view of every window.Attributes:
CMF constants [deg] the foveation slider offers every camera, with its starting one.
Methods:
__init__(camera)Create the sliders for
camera, which they hold weakly: once it is gone, they draw nothing.__new__(*args, **kwargs)- cmf_a_values: ClassVar[tuple[float, ...]] = (0.001, 0.01, 0.1, 1.0, 10.0, 100.0, 1000.0)#
CMF constants [deg] the foveation slider offers every camera, with its starting one. Assign another tuple to change them; the sliders read it as they draw.
- __init__(camera: FoveatedCamera)[source]#
Create the sliders for
camera, which they hold weakly: once it is gone, they draw nothing.The viewer cannot unregister a UI callback, so each window keeps a callback that then returns at once.
- classmethod __new__(*args, **kwargs)#