[isaacsim.sensors.camera] Isaac Sim Camera Simulation#

Warning

Deprecation: Extension deprecated since Isaac Sim 6.0.0 in favor of: isaacsim.sensors.experimental.rtx

Version: 1.7.13

Overview#

Deprecated since version 6.0.0: This extension is deprecated. Use isaacsim.sensors.experimental.rtx instead, which provides RtxCamera, CameraSensor, TiledCameraSensor, and SingleViewDepthCameraSensor.

**isaacsim.sensors.camera** provides Python APIs for working with camera prims as simulation sensors. It helps create or wrap camera prims, configure camera properties such as pose, resolution, focal length, clipping range, lens distortion, and collect rendered sensor outputs such as RGB, depth, segmentation, bounding boxes, and point clouds.

The extension exposes two main APIs: Camera for a single camera sensor and CameraView for batched access to multiple cameras. Use Camera when you need direct control over one camera, and use CameraView when you need tiled or batched data from many cameras.

Concepts#

Camera prims and render products#

A Camera represents a camera prim at a specific prim_path. If a camera prim already exists at that path, Camera wraps it. Otherwise, it creates a new camera prim.

Each camera is associated with a render product. You can let Camera create one automatically, or provide an existing render_product_path. The same render product path should not be shared by two Camera objects with different camera prims or resolutions.

Annotators#

Camera image and sensor outputs are provided through annotators. Common annotator outputs include:

  • rgb and rgba

  • distance_to_image_plane

  • distance_to_camera

  • normals

  • motion_vectors

  • occlusion

  • bounding_box_2d_tight

  • bounding_box_2d_loose

  • bounding_box_3d

  • semantic_segmentation

  • instance_segmentation

  • instance_id_segmentation

  • pointcloud

Annotators must be attached before their data appears in get_current_frame() or specialized getters such as get_rgb() and get_depth().

Camera axes#

Pose APIs support multiple camera axis conventions:

  • world: +Z up, +X forward

  • ros: +Y up, +Z forward

  • usd: +Y up, -Z forward

This is useful when moving between stage transforms, robotics conventions, and camera calibration workflows.

Key Components#

Camera#

Camera provides high level control over a single camera sensor.

It supports:

  • Creating or wrapping a camera prim

  • Setting world and local poses

  • Setting sensor update frequency or dt

  • Configuring resolution and aspect ratio

  • Attaching and detaching annotators

  • Reading current frame data

  • Reading RGB, RGBA, depth, and point cloud outputs

  • Configuring focal length, apertures, focus distance, clipping range, shutter properties, projection mode, and stereo role

  • Working with camera calibration helpers such as intrinsics and view matrices

  • Projecting world points to image coordinates and inverse-projecting image coordinates with depth

A typical single-camera setup looks like this:

from isaacsim.sensors.camera import Camera

camera = Camera(
    prim_path="/World/Camera",
    name="front_camera",
    resolution=(640, 480),
    frequency=30,
)

camera.initialize()
camera.add_rgb_to_frame()
camera.add_distance_to_image_plane_to_frame()

frame = camera.get_current_frame()
rgb = camera.get_rgb()
depth = camera.get_depth()

initialize() should be called before attaching annotators, because the camera needs a render product before annotator data can be collected.

CameraView#

CameraView provides batched access to multiple camera prims matched by a prim path expression. It is useful for multi-environment or multi-camera workflows where the same operation needs to apply to many cameras.

It supports:

  • Matching camera prims with a path expression, such as /World/Env[1-5]/Camera

  • Setting a shared camera resolution

  • Configuring output annotators at construction time

  • Reading data as a batch of images

  • Reading data as a single tiled image

  • Getting and setting poses for selected camera indices

  • Getting and setting camera properties such as focal length, focus distance, apertures, projection mode, stereo role, and shutter properties

Example:

from isaacsim.sensors.camera import CameraView

camera_view = CameraView(
    prim_paths_expr="/World/Env[1-5]/Camera",
    name="env_cameras",
    camera_resolution=(256, 256),
    output_annotators=["rgb", "distance_to_image_plane"],
)

rgb_batch = camera_view.get_rgb()
depth_batch = camera_view.get_depth()

rgb_tiled = camera_view.get_rgb_tiled(device="cpu")
depth_tiled = camera_view.get_depth_tiled(device="cpu")

get_rgb() and get_depth() return batched image tensors. The tiled getters return a single image containing all camera outputs arranged into tiles.

Functionality#

Frame collection#

Camera stores the latest available sensor outputs in its current frame. You can retrieve the whole frame with get_current_frame() or use specific getters such as get_rgb(), get_rgba(), get_depth(), and get_pointcloud().

A few rendered frames may be required after initialization before valid data becomes available.

camera.initialize()
camera.add_rgb_to_frame()

# Step/render a few frames before expecting valid data.
rgb = camera.get_rgb()
if rgb is not None:
    print(rgb.shape)

Sensor timing#

Camera can update at a requested frequency or dt, but both cannot be specified at the same time. The requested rate must align with the configured rendering frequency.

If /app/runLoops/main/rateLimitFrequency is not set, the requested frequency or dt cannot be honored. In that case, the camera processes every rendered frame and logs a warning.

Camera calibration#

Camera includes calibration-oriented helpers for pinhole projection workflows:

  • get_intrinsics_matrix()

  • get_view_matrix_ros()

  • get_image_coords_from_world_points()

  • get_camera_points_from_image_coords()

  • get_world_points_from_image_coords()

  • get_horizontal_fov()

  • get_vertical_fov()

These APIs are useful when connecting rendered sensor data to perception pipelines that expect camera matrices and pixel-space projections.

points_world = ...  # shape: (N, 3)

image_points = camera.get_image_coords_from_world_points(points_world)
intrinsics = camera.get_intrinsics_matrix()

Projection and inverse-projection helpers require a pinhole projection setup.

Lens and image model configuration#

Camera provides camera property APIs for configuring the sensor model. This includes focal length, apertures, focus distance, clipping range, shutter timing, projection mode, stereo role, and lens distortion model properties.

Supported lens distortion configuration APIs include:

  • set_ftheta_properties()

  • set_kannala_brandt_k3_properties()

  • set_rad_tan_thin_prism_properties()

  • set_lut_properties()

  • set_opencv_pinhole_properties()

  • set_opencv_fisheye_properties()

These methods apply the corresponding distortion model to the camera prim and set the required model parameters.

Usage Examples#

Single camera with RGB and depth#

from isaacsim.sensors.camera import Camera

camera = Camera(
    prim_path="/World/Robot/front_camera",
    resolution=(1280, 720),
    dt=1.0 / 30.0,
)

camera.initialize(attach_rgb_annotator=False)
camera.add_rgb_to_frame()
camera.add_distance_to_image_plane_to_frame()

rgb = camera.get_rgb()
depth = camera.get_depth()
frame = camera.get_current_frame()

Move a camera using ROS camera axes#

import numpy as np
from isaacsim.sensors.camera import Camera

camera = Camera("/World/Camera")
camera.initialize()

camera.set_world_pose(
    position=np.array([1.0, 0.0, 1.5]),
    orientation=np.array([1.0, 0.0, 0.0, 0.0]),
    camera_axes="ros",
)

position, orientation = camera.get_world_pose(camera_axes="ros")

Batched camera data#

from isaacsim.sensors.camera import CameraView

cameras = CameraView(
    prim_paths_expr="/World/Env.*/Camera",
    camera_resolution=(320, 240),
    output_annotators=["rgb", "distance_to_image_plane"],
)

rgb = cameras.get_rgb()
depth = cameras.get_depth()

print(rgb.shape)    # (num_cameras, height, width, 3)
print(depth.shape)  # (num_cameras, height, width, 1)

Considerations#

  • Call Camera.initialize() before attaching annotators or reading annotator data.

  • Do not specify both frequency and dt for a Camera.

  • Requested camera update rates must align with the configured rendering frequency.

  • CameraView requires its requested annotator types to be configured when the object is created.

  • Projection and inverse-projection helpers are intended for pinhole projection.

  • Camera aperture APIs maintain square pixels when maintain_square_pixels=True.

Preview

Enable Extension#

The extension can be enabled (if not already) in one of the following ways:

Define the next entry as an application argument from a terminal.

APP_SCRIPT.(sh|bat) --enable isaacsim.sensors.camera

Define the next entry under [dependencies] in an experience (.kit) file or an extension configuration (extension.toml) file.

[dependencies]
"isaacsim.sensors.camera" = {}

Open the Window > Extensions menu in a running application instance and search for isaacsim.sensors.camera. Then, toggle the enable control button if it is not already active.

Python API#

Camera

Provides high level functions for a camera prim and its attributes/properties.

CameraView

Provide high level functions to deal with tiled/batched data from cameras.


class Camera(
prim_path: str,
name: str = 'camera',
frequency: int | None = None,
dt: float | None = None,
resolution: tuple[int, int] | None = None,
position: ndarray | None = None,
orientation: ndarray | None = None,
translation: ndarray | None = None,
render_product_path: str = None,
annotator_device: str = None,
)#

Bases: BaseSensor

Provides high level functions for a camera prim and its attributes/properties.

If there is a camera prim present at the path, it will use it. Otherwise, a new Camera prim at the specified prim path will be created.

Parameters:
  • prim_path – Prim path of the Camera prim to encapsulate or create.

  • name – Short name to be used as a key by Scene class. Note: Needs to be unique if the object is added to the Scene.

  • frequency – Frequency of the sensor (i.e., how often the data frame is updated).

  • dt – Time step of the sensor (i.e., period at which the data frame is updated).

  • resolution – Resolution of the camera (width, height).

  • position – Position in the world frame of the prim. Shape is (3, ).

  • orientation – Quaternion orientation in the world/local frame of the prim (depends on whether translation or position is specified). Quaternion is scalar-first (w, x, y, z). Shape is (4, ).

  • translation – Translation in the local frame of the prim (with respect to its parent prim). Shape is (3, ).

  • render_product_path – Path to an existing render product, used instead of creating a new render product. The resolution and camera attached to this render product will be set based on the input arguments. Note: Using the same render product path on two Camera objects with different camera prims or resolutions is not supported.

  • annotator_device – Device to place tensors on for annotators.

Raises:
  • Exception – If both frequency and dt are specified.

  • Exception – If prim_path points to an existing prim that is not a Camera prim.

  • Exception – If the requested sensor frequency is not a divisor of the configured rendering frequency.

add_bounding_box_2d_loose_to_frame(
init_params: dict | None = None,
) None#

Attach the bounding_box_2d_loose annotator to this camera.

Parameters:

init_params – Annotator parameters, such as {“semanticTypes”: [“prim”]}. semanticTypes filters the whole render product rather than this annotator alone; see attach_annotator() for how to give an annotator its own filter.

Note

The bounding_box_2d_loose annotator returns:

np.array
shape: (num_objects, 1)
dtype: np.dtype([
    ("semanticId", "<u4"),
    ("x_min", "<i4"),
    ("y_min", "<i4"),
    ("x_max", "<i4"),
    ("y_max", "<i4"),
    ("occlusionRatio", "<f4"),
])

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#bounding-box-2d-loose

Raises:
  • RuntimeError – If initialize() has not been called before attaching the annotator.

  • rep.annotators.AnnotatorRegistryError – If the annotator is not found.

add_bounding_box_2d_tight_to_frame(
init_params: dict | None = None,
) None#

Attach the bounding_box_2d_tight annotator to this camera.

Parameters:

init_params – Annotator parameters, such as {“semanticTypes”: [“prim”]}. semanticTypes filters the whole render product rather than this annotator alone; see attach_annotator() for how to give an annotator its own filter.

Note

The bounding_box_2d_tight annotator returns:

np.array
shape: (num_objects, 1)
dtype: np.dtype([
    ("semanticId", "<u4"),
    ("x_min", "<i4"),
    ("y_min", "<i4"),
    ("x_max", "<i4"),
    ("y_max", "<i4"),
    ("occlusionRatio", "<f4"),
])

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#bounding-box-2d-tight

Raises:
  • RuntimeError – If initialize() has not been called before attaching the annotator.

  • rep.annotators.AnnotatorRegistryError – If the annotator is not found.

add_bounding_box_3d_to_frame(
init_params: dict | None = None,
) None#

Attach the bounding_box_3d annotator to this camera.

Parameters:

init_params – Annotator parameters, such as {“semanticTypes”: [“prim”]}. semanticTypes filters the whole render product rather than this annotator alone; see attach_annotator() for how to give an annotator its own filter.

Raises:
  • RuntimeError – If initialize() has not been called before attaching the annotator.

  • rep.annotators.AnnotatorRegistryError – If the annotator is not found.

add_distance_to_camera_to_frame(
init_params: dict | None = None,
) None#

Attach the distance_to_camera annotator to this camera.

Parameters:

init_params – Annotator parameters passed to the distance_to_camera annotator.

Raises:
  • RuntimeError – If initialize() has not been called.

  • rep.annotators.AnnotatorRegistryError – If the distance_to_camera annotator is not found.

Note

The distance_to_camera annotator returns:

np.array
shape: (width, height, 1)
dtype: np.float32

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#distance-to-camera

add_distance_to_image_plane_to_frame(
init_params: dict | None = None,
) None#

Attach the distance_to_image_plane annotator to this camera.

Parameters:

init_params – Annotator parameters passed to the distance_to_image_plane annotator.

Raises:
  • RuntimeError – If initialize() has not been called.

  • rep.annotators.AnnotatorRegistryError – If the distance_to_image_plane annotator is not found.

Note

The distance_to_image_plane annotator returns:

np.array
shape: (width, height, 1)
dtype: np.float32

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#distance-to-image-plane

add_instance_id_segmentation_to_frame(
init_params: dict | None = None,
) None#

Attach the instance_id_segmentation annotator to this camera.

Parameters:

init_params – Parameters used to initialize the annotator.

Note

The instance_id_segmentation annotator returns:

np.array
shape: (width, height, 1) or (width, height, 4) if `colorize` is set to true
dtype: np.uint32 or np.uint8 if `colorize` is set to true, such as {"colorize": True}

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#instance-id-segmentation

Raises:
  • RuntimeError – If initialize() has not been called before attaching the annotator.

  • rep.annotators.AnnotatorRegistryError – If the annotator is not found.

add_instance_segmentation_to_frame(
init_params: dict | None = None,
) None#

Attach the instance_segmentation annotator to this camera.

The main difference between instance id segmentation and instance segmentation is that the instance_segmentation annotator goes down the hierarchy to the lowest level prim with semantic labels, while instance id segmentation always goes down to the leaf prim.

Parameters:

init_params – Parameters used to initialize the annotator, e.g. init_params={“colorize”: True}.

Raises:
  • RuntimeError – If initialize() has not been called and no render product exists.

  • rep.annotators.AnnotatorRegistryError – If the annotator is not found.

The instance_segmentation annotator returns:

np.array
shape: (width, height, 1) or (width, height, 4) if `colorize` is set to true
dtype: np.uint32 or np.uint8 if `colorize` is set to true

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#instance-segmentation

add_motion_vectors_to_frame(
init_params: dict | None = None,
) None#

Attach the motion vectors annotator to this camera.

Parameters:

init_params – Annotator parameters passed to the motion vectors annotator.

Raises:
  • RuntimeError – If initialize() has not been called.

  • rep.annotators.AnnotatorRegistryError – If the motion vectors annotator is not found.

Note

The motion vectors annotator returns:

np.array
shape: (width, height, 4)
dtype: np.float32

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#motion-vectors

add_normals_to_frame(init_params: dict | None = None) None#

Attach the normals annotator to this camera.

Parameters:

init_params – Annotator parameters passed to the normals annotator.

Raises:
  • RuntimeError – If initialize() has not been called.

  • rep.annotators.AnnotatorRegistryError – If the normals annotator is not found.

Note

The normals annotator returns:

np.array
shape: (width, height, 4)
dtype: np.float32

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#normals

add_occlusion_to_frame(init_params: dict | None = None) None#

Attach the occlusion annotator to this camera.

Parameters:

init_params – Annotator parameters passed to the occlusion annotator.

Raises:
  • RuntimeError – If initialize() has not been called.

  • rep.annotators.AnnotatorRegistryError – If the occlusion annotator is not found.

Note

The occlusion annotator returns:

np.array
shape: (num_objects, 1)
dtype: np.dtype([("instanceId", "<u4"), ("semanticId", "<u4"), ("occlusionRatio", "<f4")])
add_pointcloud_to_frame(
include_unlabelled: bool = True,
init_params: dict | None = None,
) None#

Attach the pointcloud annotator to this camera.

Parameters:
  • include_unlabelled – Whether to include unlabelled points in the pointcloud.

  • init_params – Parameters used to initialize the annotator with.

Raises:
  • RuntimeError – If initialize() has not been called and no render product exists.

  • rep.annotators.AnnotatorRegistryError – If the annotator is not found.

The pointcloud annotator returns:

np.array
shape: (num_points, 3)
dtype: np.float32

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#point-cloud

add_rgb_to_frame(init_params: dict | None = None) None#

Attach the rgb annotator to this camera.

Parameters:

init_params – Annotator parameters to pass to the rgb annotator.

The rgb annotator returns:

np.array
shape: (width, height, 4)
dtype: np.float32

See more details at https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#ldrcolor

Raises:
  • RuntimeError – If initialize() has not been called and no render product exists.

  • rep.annotators.AnnotatorRegistryError – If the rgb annotator is not found.

add_semantic_segmentation_to_frame(
init_params: dict | None = None,
) None#

Attach the semantic_segmentation annotator to this camera.

Parameters:

init_params – Parameters used to initialize the annotator.

Note

The semantic_segmentation annotator returns:

np.array
shape: (width, height, 1) or (width, height, 4) if `colorize` is set to true
dtype: np.uint32 or np.uint8 if `colorize` is set to true, such as {"colorize": True}

See more details: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator/annotators_details.html#semantic-segmentation

Raises:
  • RuntimeError – If initialize() has not been called before attaching the annotator.

  • rep.annotators.AnnotatorRegistryError – If the annotator is not found.

apply_visual_material(
visual_material: VisualMaterial,
weaker_than_descendants: bool = False,
) None#

Apply visual material to the held prim and optionally its descendants.

Parameters:
  • visual_material – Visual material to be applied to the held prim. Currently supports PreviewSurface, OmniPBR and OmniGlass.

  • weaker_than_descendants – True if the material shouldn’t override the descendants materials, otherwise False.

Example:

>>> from isaacsim.core.api.materials import OmniGlass
>>>
>>> # create a dark-red glass visual material
>>> material = OmniGlass(
...     prim_path="/World/material/glass",  # path to the material prim to create
...     ior=1.25,
...     depth=0.001,
...     thin_walled=False,
...     color=np.array([0.5, 0.0, 0.0])
... )
>>> prim.apply_visual_material(material)
attach_annotator(annotator_name: str, **kwargs: object) None#

Attach an annotator to the camera.

The annotator data will be available in get_current_frame() using a normalized key, such as “bounding_box_2d_tight” for both “bounding_box_2d_tight” and “bounding_box_2d_tight_fast”.

Note

initialize() must be called before this method so the camera’s render product exists. Calling attach_annotator() beforehand or after destroy() raises RuntimeError instead of an opaque error from omni.syntheticdata.

Note

A semantic filter (semanticTypes or semanticFilter) belongs to the render product, not to an individual annotator. Every bounding box and segmentation annotator on this camera therefore shares one filter, and the last annotator attached determines its value. To filter one annotator differently, give it its own render product on the same camera prim and pass that render product to a second Camera:

import omni.replicator.core as rep

camera.initialize()
# force_new is required, otherwise the camera's existing render product is returned
render_product = rep.create.render_product(camera.prim_path, resolution, force_new=True)
filtered_camera = Camera(
    prim_path=camera.prim_path, name="filtered", render_product_path=render_product.path
)
filtered_camera.initialize()
filtered_camera.add_bounding_box_2d_tight_to_frame(init_params={"semanticTypes": ["prim"]})
Parameters:
  • annotator_name – Name of the annotator to attach, as registered in replicator.

  • **kwargs – Additional arguments to pass to the annotator.

Raises:
  • RuntimeError – If initialize() has not been called and no render product exists.

  • rep.annotators.AnnotatorRegistryError – If the annotator is not found.

destroy() None#

Destroy the camera by detaching all annotators and destroying the internal render product.

Clears all event subscriptions after releasing camera resources.

detach_annotator(annotator_name: str) None#

Detach an annotator from the camera.

The annotator is looked up using a normalized key, such as “bounding_box_2d_tight” for both “bounding_box_2d_tight” and “bounding_box_2d_tight_fast”.

Parameters:

annotator_name – Name of the annotator to detach.

get_applied_visual_material() VisualMaterial#

Return the current applied visual material if it was applied using apply_visual_material or is one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.

Returns:

The current applied visual material if its type is currently supported.

Example:

>>> # given a visual material applied
>>> prim.get_applied_visual_material()
<isaacsim.core.api.materials.omni_glass.OmniGlass object at 0x7f36263106a0>
get_aspect_ratio() float#

Camera aspect ratio.

Returns:

Ratio between width and height.

get_camera_points_from_image_coords(
points_2d: object,
depth: object,
device: str = None,
backend_utils_cls: type = None,
) ndarray | Tensor | array#

Inverse-projects pixel coordinates and depth to 3D points in camera frame using pinhole perspective projection.

Parameters:
  • points_2d – 2d points (u, v) corresponds to the pixel coordinates. shape is (n, 2) where n is the number of points.

  • depth – Depth corresponds to each of the pixel coords. shape is (n,).

  • device – Device to place tensors on. Select from [‘cpu’, ‘cuda’, ‘cuda:<device_index>’]. If None, uses self._device.

  • backend_utils_cls – Backend utility class. If None, the class is inferred from self._backend_utils. Supported classes are np_utils, torch_utils, and warp_utils.

Returns:

(n, 3) 3d points (X, Y, Z) in camera frame. +Z points forward (optical axis), +X right, +Y down.

Raises:

Exception – If the pinhole projection type is not set.

get_clipping_range() tuple[float, float]#

Gets near and far clipping distances of camera prim.

Returns:

Near and far clipping distances (in stage units).

get_current_frame(clone: bool = False) dict#

Gets the current frame of data.

Parameters:

clone – If True, returns a deepcopy of the current frame.

Returns:

The current frame of data.

get_default_state() XFormPrimState#

Get the default prim states (spatial position and orientation).

Returns:

An object that contains the default state of the prim (position and orientation).

Example:

>>> state = prim.get_default_state()
>>> state
<isaacsim.core.utils.types.XFormPrimState object at 0x7f33addda650>
>>>
>>> state.position
[-4.5299529e-08 -1.8347054e-09 -2.8610229e-08]
>>> state.orientation
[1. 0. 0. 0.]
get_depth(
device: str = None,
) ndarray | array#

Get the depth data from the camera sensor as distance to the image plane.

Parameters:

device – Device to hold data in. Select from [‘cpu’, ‘cuda’, ‘cuda:<device_index>’]. Uses the device specified on annotator initialization when not provided.

Returns:

(height, width) depth data, or None if the annotator is not attached or data is invalid.

Note

A few render frames may be required after initialization before valid data becomes available.

get_dt() float#

Gets the dt to acquire new data frames.

Returns:

The dt to acquire new data frames.

get_fisheye_polynomial_properties() tuple[float, float, float, float, float, list]#

Fisheye polynomial projection parameters.

Returns:

A tuple containing nominal_width, nominal_height, optical_centre_x, optical_centre_y, max_fov, and polynomial.

Raises:

Exception – If the fisheye projection type is not set.

get_focal_length() float#

Focal length of camera prim, in stage units. Longer focal length corresponds to narrower FOV, and shorter focal length corresponds to wider FOV.

Returns:

Value of camera prim focalLength attribute, converted to stage units.

get_focus_distance() float#

Gets distance from the camera to the focus plane (in stage units).

Returns:

Value of camera prim focusDistance attribute, measuring distance from the camera to the focus plane (in stage units).

get_frequency() float#

Gets the frequency to acquire new data frames.

Returns:

The frequency to acquire new data frames.

get_ftheta_properties() tuple[float, float, tuple[float, float], float, list[float]]#

Gets F-theta lens distortion model parameters if the camera prim is using the F-theta distortion model.

Returns:

A tuple of (nominal_height (pixels), nominal_width (pixels), optical_center (x, y in pixels), max_fov (degrees), distortion_coefficients), with distortion_coefficients ordered as [k0, k1, k2, k3, k4] radial distortion coefficients.

get_horizontal_aperture() float#

Get horizontal aperture (sensor width) in stage units.

Only square pixels are supported; vertical aperture should match aspect ratio.

Returns:

Horizontal aperture in stage units.

get_horizontal_fov() float#

Horizontal field of view angle computed from horizontal aperture and focal length.

Returns:

Horizontal field of view angle in radians.

get_image_coords_from_world_points(
points_3d: ndarray,
) ndarray#

Projects 3d points in the world frame to image plane pixel coordinates using pinhole perspective projection.

Parameters:

points_3d – 3d points (X, Y, Z) in world frame. shape is (n, 3) where n is the number of points.

Returns:

2d points (u, v) corresponding to pixel coordinates. shape is (n, 2) where n is the number of points.

Raises:

Exception – If the pinhole projection type is not set.

get_intrinsics_matrix(
device: str = None,
backend_utils_cls: type = None,
) ndarray | Tensor | array#

Intrinsics matrix of the camera.

Parameters:
  • device – Device to place tensors on. Select from [‘cpu’, ‘cuda’, ‘cuda:<device_index>’]. If None, uses self._device.

  • backend_utils_cls – Backend utility class. If None, the class is inferred from self._backend_utils. Supported classes are np_utils, torch_utils, and warp_utils.

Returns:

The intrinsics matrix of the camera used for calibration.

Raises:
  • Exception – If the pinhole projection type is not set.

  • ValueError – If backend_utils_cls is not np_utils, torch_utils, or warp_utils.

get_kannala_brandt_k3_properties() tuple[float, float, tuple[float, float], float, list[float]]#

Gets Kannala-Brandt K3 lens distortion model parameters for a camera prim using the Kannala-Brandt K3 model.

Returns:

A tuple of (nominal_height, nominal_width, optical_center, max_fov, distortion_coefficients), with distortion_coefficients ordered as [k0, k1, k2, k3] radial distortion coefficients.

get_lens_aperture() float#

Gets value of camera prim fStop attribute, which controls distance blurring. Lower numbers decrease focus range, larger numbers increase it.

Returns:

Value of camera prim fStop attribute. 0 turns off focusing.

get_lens_distortion_model() str#

Gets the omni:lensdistortion:model property of the camera prim.

Returns:

The lens distortion model name, or “pinhole” if unset.

get_local_pose(
camera_axes: str = 'world',
) tuple[ndarray, ndarray]#

Gets prim’s pose with respect to the local frame.

The local frame is the prim’s parent frame in the world axes.

Parameters:

camera_axes – Camera axes. world is (+Z up, +X forward), ros is (+Y up, +Z forward), and usd is (+Y up and -Z forward).

Returns:

A tuple containing the position in the local frame of the prim with shape (3, ) and the quaternion orientation in the local frame of the prim. The quaternion is scalar-first (w, x, y, z) with shape (4, ).

Raises:

Exception – If camera_axes is not world, ros, or usd.

get_local_scale() ndarray#

Get prim’s scale with respect to the local frame (the parent’s frame).

Returns:

Scale applied to the prim’s dimensions in the local frame. shape is (3, ).

Example:

>>> prim.get_local_scale()
[1. 1. 1.]
get_lut_properties() tuple[float, float, tuple[float, float], str, str]#

Gets LUT lens distortion model parameters if camera prim is using LUT distortion model.

Returns:

A tuple containing (nominal_height (pixels), nominal_width (pixels), optical_center (x,y in pixels), ray_enter_direction_texture, ray_exit_position_texture).

get_opencv_fisheye_properties() tuple[float, float, float, float, list]#

If camera prim is using OpenCV fisheye distortion model, returns corresponding distortion parameters.

Returns:

A tuple containing (cx, cy, fx, fy, OpenCV fisheye parameters [k1, k2, k3, k4]).

get_opencv_pinhole_properties() tuple[float, float, float, float, list]#

If camera prim is using OpenCV pinhole distortion model, returns corresponding distortion parameters.

Returns:

A tuple containing (cx, cy, fx, fy, OpenCV pinhole parameters [k1, k2, p1, p2, k3, k4, k5, k6, s1, s2, s3, s4]).

get_pointcloud(
device: str = None,
world_frame: bool = True,
) ndarray | array#

Get a 3D pointcloud from the camera sensor.

This method attempts to use the pointcloud annotator first, falling back to depth-based calculation using the distance_to_image_plane annotator and perspective projection with the camera’s intrinsic parameters.

Parameters:
  • device – Device to place tensors on. Select from [‘cpu’, ‘cuda’, ‘cuda:<device_index>’]. Uses self._annotator_device when not provided.

  • world_frame – Whether to return points in world frame instead of camera frame.

Returns:

A (N, 3) array of 3D points (X, Y, Z) in either world or camera frame, where N is the number of points. Returns an empty array if data is not available.

Raises:

Exception – If the depth-based fallback is used and the camera lens distortion model is not pinhole.

Note

A few render frames may be required after initialization before valid data becomes available. The fallback method uses the depth (distance_to_image_plane) annotator and performs a perspective projection using the camera’s intrinsic parameters to generate the pointcloud. Point ordering may differ between the pointcloud annotator and depth-based fallback methods, even though the 3D locations are equivalent.

get_projection_mode() str#

Gets projection model of the camera prim.

Returns:

Projection model value, either “perspective” or “orthographic”.

get_projection_type() str#

[DEPRECATED] Gets the cameraProjectionType property of the camera prim.

Returns:

cameraProjectionType attribute of the camera prim, or “pinhole” if unset.

get_rad_tan_thin_prism_properties() tuple[float, float, tuple[float, float], float, list[float]]#

Gets Radial-Tangential Thin Prism lens distortion model parameters for a camera prim using that distortion model.

Returns:

A tuple of (nominal_height, nominal_width, optical_center, max_fov, distortion_coefficients), with distortion_coefficients ordered as [k0, k1, k2, k3, k4, k5] radial distortion coefficients, [p0, p1] tangential distortion coefficients, and [s0, s1, s2, s3] thin prism distortion coefficients.

get_render_product_path() str#

Gets the path to the render product attached to this camera.

Returns:

Path to the render product attached to this camera.

get_resolution() tuple[int, int]#

Camera resolution in pixels.

Returns:

Width and height respectively.

get_rgb(
device: str = None,
) ndarray | array#

Get RGB color data from the camera sensor.

Parameters:

device – Device to hold data in. Select from [‘cpu’, ‘cuda’, ‘cuda:<device_index>’]. Uses the device specified on annotator initialization when not provided.

Returns:

(height, width, 3) RGB color data, or None if the annotator is not attached or data is invalid.

Note

A few render frames may be required after initialization before valid data becomes available.

get_rgba(
device: str = None,
) ndarray | array#

Get RGBA color data from the camera sensor.

Parameters:

device – Device to hold data in. Select from [‘cpu’, ‘cuda’, ‘cuda:<device_index>’]. Uses the device specified on annotator initialization when not provided.

Returns:

(height, width, 4) RGBA color data, or None if the annotator is not attached or data is invalid.

Note

A few render frames may be required after initialization before valid data becomes available.

get_shutter_properties() tuple[float, float]#

Shutter properties for motion blur control.

Returns:

delay_open and delay close respectively.

get_stereo_role() str#

Gets stereo role of the camera prim.

Returns:

Stereo role value, either “mono”, “left”, or “right”.

get_vertical_aperture() float#

Get vertical aperture (sensor height) in stage units.

This function ensures the vertical aperture is always synchronized with the aspect ratio and horizontal aperture to maintain square pixels. If not, it will automatically correct the value.

Returns:

Vertical aperture in stage units, always in sync with the aspect ratio and horizontal aperture.

get_vertical_fov() float#

Vertical field of view angle computed from horizontal field of view and resolution aspect ratio.

Returns:

Vertical field of view angle in radians.

get_view_matrix_ros(
device: str = None,
backend_utils_cls: type = None,
) ndarray | Tensor | array#

3D points in World Frame -> 3D points in Camera ROS Frame.

Parameters:
  • device – Device to place tensors on. Select from [‘cpu’, ‘cuda’, ‘cuda:<device_index>’]. If None, uses self._device.

  • backend_utils_cls – Backend utility class. If None, the class is inferred from self._backend_utils. Supported classes are np_utils, torch_utils, and warp_utils.

Returns:

The view matrix that transforms 3d points in the world frame to 3d points in the camera axes with ROS camera convention.

get_visibility() bool#

Get the visibility of the prim in stage.

Returns:

True if the prim is visible in stage. False otherwise.

Example:

>>> # get the visible state of a visible prim on the stage
>>> prim.get_visibility()
True
get_world_points_from_image_coords(
points_2d: object,
depth: object,
device: str = None,
backend_utils_cls: type = None,
) ndarray | Tensor | array#

Inverse-projects pixel coordinates and depth to 3D points in world frame using pinhole perspective projection.

Parameters:
  • points_2d – 2d points (u, v) corresponds to the pixel coordinates. shape is (n, 2) where n is the number of points.

  • depth – Depth corresponds to each of the pixel coords. shape is (n,).

  • device – Device to place tensors on. Select from [‘cpu’, ‘cuda’, ‘cuda:<device_index>’]. If None, uses self._device.

  • backend_utils_cls – Backend utility class. If None, the class is inferred from self._backend_utils. Supported classes are np_utils, torch_utils, and warp_utils.

Returns:

(n, 3) 3d points (X, Y, Z) in world frame.

Raises:

Exception – If the pinhole projection type is not set.

get_world_pose(
camera_axes: str = 'world',
) tuple[ndarray, ndarray]#

Gets prim’s pose with respect to the world’s frame.

The world’s frame is always at [0, 0, 0] with unity quaternion and is not the /World Prim.

Parameters:

camera_axes – Camera axes. world is (+Z up, +X forward), ros is (+Y up, +Z forward), and usd is (+Y up and -Z forward).

Returns:

A tuple containing the position in the world frame of the prim with shape (3, ) and the quaternion orientation in the world frame of the prim. The quaternion is scalar-first (w, x, y, z) with shape (4, ).

Raises:

Exception – If camera_axes is not world, ros, or usd.

get_world_scale() ndarray#

Get prim’s scale with respect to the world’s frame.

Returns:

Scale applied to the prim’s dimensions in the world frame. shape is (3, ).

Example:

>>> prim.get_world_scale()
[1. 1. 1.]
initialize(
physics_sim_view: object = None,
attach_rgb_annotator: bool = True,
) None#

To be called before using this class after a reset of the world.

Parameters:
  • physics_sim_view – Current physics simulation view.

  • attach_rgb_annotator – True to attach the rgb annotator to the camera. Set to False to improve performance.

is_paused() bool#

Data collection pause status.

Returns:

Whether data collection is paused.

is_valid() bool#

Check if the prim path has a valid USD Prim at it.

Returns:

True if the current prim path corresponds to a valid prim in stage. False otherwise.

Example:

>>> # given an existing and valid prim
>>> prims.is_valid()
True
is_visual_material_applied() bool#

Check if there is a visual material applied.

Returns:

True if there is a visual material applied. False otherwise.

Example:

>>> # given a visual material applied
>>> prim.is_visual_material_applied()
True
pause() None#

Pause data collection and data frame updates.

post_reset() None#

Reset camera’s elapsed time and previous time after simulation reset.

Resets internal timing state used for data collection frequency control.

remove_bounding_box_2d_loose_from_frame() None#

Detach the bounding_box_2d_loose annotator from the camera.

remove_bounding_box_2d_tight_from_frame() None#

Detach the bounding_box_2d_tight annotator from the camera.

remove_bounding_box_3d_from_frame() None#

Detach the bounding_box_3d annotator from the camera.

remove_distance_to_camera_from_frame() None#

Detach the distance_to_camera annotator from the camera.

remove_distance_to_image_plane_from_frame() None#

Detach the distance_to_image_plane annotator from the camera.

remove_instance_id_segmentation_from_frame() None#

Detach the instance_id_segmentation annotator from the camera.

remove_instance_segmentation_from_frame() None#

Detach the instance_segmentation annotator from the camera.

remove_motion_vectors_from_frame() None#

Detach the motion vectors annotator from the camera.

remove_normals_from_frame() None#

Detach the normals annotator from the camera.

remove_occlusion_from_frame() None#

Detach the occlusion annotator from the camera.

remove_pointcloud_from_frame() None#

Detach the pointcloud annotator from the camera.

remove_rgb_from_frame() None#

Detach the rgb annotator from the camera.

remove_semantic_segmentation_from_frame() None#

Detach the semantic_segmentation annotator from the camera.

resume() None#

Resume data collection and data frame updates.

set_clipping_range(
near_distance: float | None = None,
far_distance: float | None = None,
) None#

Sets near and far clipping distances of camera prim.

Parameters:
  • near_distance – Value to be used for near clipping (in stage units).

  • far_distance – Value to be used for far clipping (in stage units).

set_default_state(
position: Sequence[float] | None = None,
orientation: Sequence[float] | None = None,
) None#

Set the default state of the prim (position and orientation), that will be used after each reset.

Parameters:
  • position – Position in the world frame of the prim. shape is (3, ). If None, the position is left unchanged.

  • orientation – Quaternion orientation in the world frame of the prim. Quaternion is scalar-first (w, x, y, z). shape is (4, ). If None, the orientation is left unchanged.

Example:

>>> # configure default state
>>> prim.set_default_state(position=np.array([1.0, 0.5, 0.0]), orientation=np.array([1, 0, 0, 0]))
>>>
>>> # set default states during post-reset
>>> prim.post_reset()
set_dt(value: float) None#

Sets the dt to acquire new data frames.

If /app/runLoops/main/rateLimitFrequency is unset (common in headless launches or custom Kit apps without rate-limit configuration), the requested dt cannot be honored and the camera falls back to processing every rendered frame; a warning is logged so the discrepancy is observable at the call site.

Parameters:

value – The dt to acquire new data frames.

Raises:

Exception – If value is not a multiple of the configured rendering dt.

set_fisheye_polynomial_properties(
nominal_width: float | None,
nominal_height: float | None,
optical_centre_x: float | None,
optical_centre_y: float | None,
max_fov: float | None,
polynomial: Sequence[float] | None,
) None#

[DEPRECATED] Sets distortion parameters for the fisheyePolynomial projection model.

Parameters:
  • nominal_width – Rendered Width (pixels)

  • nominal_height – Rendered Height (pixels)

  • optical_centre_x – Horizontal Render Position (pixels)

  • optical_centre_y – Vertical Render Position (pixels)

  • max_fov – maximum field of view (pixels)

  • polynomial – polynomial equation coefficients (sequence of 5 numbers) starting from A0, A1, A2, A3, A4

Raises:

Exception – If fisheye projection type is not set.

set_focal_length(value: float) None#

Set focal length of camera prim, in stage units. Longer focal length corresponds to narrower FOV, and shorter focal length corresponds to wider FOV.

Parameters:

value – Desired focal length of camera prim, in stage units.

set_focus_distance(value: float) None#

Sets distance from the camera to the focus plane (in stage units).

Parameters:

value – Value for camera prim focusDistance attribute (in stage units).

set_frequency(value: int) None#

Sets the frequency to acquire new data frames.

If /app/runLoops/main/rateLimitFrequency is unset (common in headless launches or custom Kit apps without rate-limit configuration), the requested frequency cannot be honored and the camera falls back to processing every rendered frame; a warning is logged so the discrepancy is observable at the call site.

Parameters:

value – The frequency to acquire new data frames.

Raises:

Exception – If value is not a divisor of the configured rendering frequency.

set_ftheta_properties(
nominal_height: float | None = None,
nominal_width: float | None = None,
optical_center: tuple[float, float] | None = None,
max_fov: float | None = None,
distortion_coefficients: Sequence[float] | None = None,
) None#

Applies F-theta lens distortion model to the camera prim, then sets distortion parameters.

Parameters:
  • nominal_height – Height of the calibrated sensor in pixels.

  • nominal_width – Width of the calibrated sensor in pixels.

  • optical_center – Optical center (x, y) in pixels.

  • max_fov – Maximum field of view in degrees.

  • distortion_coefficients – Distortion coefficients in the following order. [k0, k1, k2, k3, k4] - radial distortion coefficients.

set_horizontal_aperture(
value: float,
maintain_square_pixels: bool = True,
) None#

Set horizontal aperture (sensor width) in stage units and update vertical for square pixels.

Only square pixels are supported; vertical aperture is updated to match aspect ratio.

Parameters:
  • value – Horizontal aperture in stage units.

  • maintain_square_pixels – If True, keep apertures in sync for square pixels.

set_kannala_brandt_k3_properties(
nominal_height: float | None = None,
nominal_width: float | None = None,
optical_center: tuple[float, float] | None = None,
max_fov: float | None = None,
distortion_coefficients: Sequence[float] | None = None,
) None#

Applies Kannala-Brandt K3 lens distortion model to the camera prim, then sets distortion parameters.

Parameters:
  • nominal_height – Height of the calibrated sensor in pixels.

  • nominal_width – Width of the calibrated sensor in pixels.

  • optical_center – Optical center (x, y) in pixels.

  • max_fov – Maximum field of view in degrees.

  • distortion_coefficients – Distortion coefficients in the following order. [k0, k1, k2, k3] - radial distortion coefficients.

set_kannala_brandt_properties(
nominal_width: float,
nominal_height: float,
optical_centre_x: float,
optical_centre_y: float,
max_fov: float | None,
distortion_model: Sequence[float],
) None#

[DEPRECATED] Sets OpenCV fisheye distortion parameters from Kannala Brandt coefficients.

Note

This method was designed to approximate the OpenCV fisheye distortion model using ftheta fisheye polynomial parameterization. The OpenCV fisheye distortion model is now directly supported, so this method uses that model directly.

Parameters:
  • nominal_width – Rendered Width (pixels).

  • nominal_height – Rendered Height (pixels).

  • optical_centre_x – Horizontal Render Position (pixels).

  • optical_centre_y – Vertical Render Position (pixels).

  • max_fov – DEPRECATED. Maximum field of view (pixels).

  • distortion_model – Kannala Brandt generic distortion model coefficients (k1, k2, k3, k4).

set_lens_aperture(value: float) None#

Sets value of camera prim fStop attribute, which controls distance blurring. Lower numbers decrease focus range, larger numbers increase it.

Parameters:

value – Value for camera prim fStop attribute. 0 turns off focusing.

set_lens_distortion_model(value: str) None#

Sets the omni:lensdistortion:model property of the camera prim and applies the corresponding schema.

Note

cameraProjectionType has been deprecated in favor of omni:lensdistortion:model. fisheyeOrthographic, fisheyeEquidistant, fisheyeEquisolid, and fisheyeSpherical are no longer supported.

Parameters:

value – Name of the distortion schema to apply, or “pinhole” to remove any distortion schemas and unset omni:lensdistortion:model.

set_local_pose(
translation: Sequence[float] | None = None,
orientation: Sequence[float] | None = None,
camera_axes: str = 'world',
) None#

Sets prim’s pose with respect to the local frame.

The local frame is the prim’s parent frame in the world axes.

Parameters:
  • translation – Translation in the local frame of the prim (with respect to its parent prim). shape is (3, ).

  • orientation – Quaternion orientation in the local frame of the prim. quaternion is scalar-first (w, x, y, z). shape is (4, ).

  • camera_axes – Camera axes. world is (+Z up, +X forward), ros is (+Y up, +Z forward), and usd is (+Y up and -Z forward).

Raises:

Exception – If camera_axes is not world, ros, or usd.

set_local_scale(
scale: Sequence[float] | None,
) None#

Set prim’s scale with respect to the local frame (the prim’s parent frame).

Parameters:

scale – Scale to be applied to the prim’s dimensions. shape is (3, ).

Example:

>>> # scale prim 10 times smaller
>>> prim.set_local_scale(np.array([0.1, 0.1, 0.1]))
set_lut_properties(
nominal_height: float | None = None,
nominal_width: float | None = None,
optical_center: tuple[float, float] | None = None,
ray_enter_direction_texture: str | None = None,
ray_exit_position_texture: str | None = None,
) None#

Applies LUT lens distortion model to camera prim, then sets distortion parameters.

Parameters:
  • nominal_height – Height of the calibrated sensor in pixels.

  • nominal_width – Width of the calibrated sensor in pixels.

  • optical_center – Optical center (x, y) in pixels.

  • ray_enter_direction_texture – Path to ray enter direction texture.

  • ray_exit_position_texture – Path to ray exit position texture.

set_matching_fisheye_polynomial_properties(
nominal_width: float,
nominal_height: float,
optical_centre_x: float,
optical_centre_y: float,
max_fov: float | None,
distortion_model: Sequence[float],
distortion_fn: Callable,
) None#

[DEPRECATED] Approximates provided OpenCV fisheye distortion with ftheta fisheye polynomial coefficients.

Parameters:
  • nominal_width – Rendered Width (pixels)

  • nominal_height – Rendered Height (pixels)

  • optical_centre_x – Horizontal Render Position (pixels)

  • optical_centre_y – Vertical Render Position (pixels)

  • max_fov – maximum field of view (pixels)

  • distortion_model – distortion model coefficients

  • distortion_fn – distortion function that takes points and returns distorted points

Raises:

Exception – If fisheye projection type is not set.

set_opencv_fisheye_properties(
cx: float | None = None,
cy: float | None = None,
fx: float | None = None,
fy: float | None = None,
fisheye: list[float] | None = None,
) None#

Applies OpenCV fisheye distortion model to camera prim, then sets distortion parameters.

Parameters:
  • cx – Horizontal Render Position (pixels).

  • cy – Vertical Render Position (pixels).

  • fx – Horizontal Focal Length (pixels).

  • fy – Vertical Focal Length (pixels).

  • fisheye – OpenCV fisheye parameters [k1, k2, k3, k4].

set_opencv_pinhole_properties(
cx: float | None = None,
cy: float | None = None,
fx: float | None = None,
fy: float | None = None,
pinhole: list[float] | None = None,
) None#

Applies OpenCV pinhole distortion model to camera prim, then sets distortion parameters.

Parameters:
  • cx – Horizontal Render Position (pixels).

  • cy – Vertical Render Position (pixels).

  • fx – Horizontal Focal Length (pixels).

  • fy – Vertical Focal Length (pixels).

  • pinhole – OpenCV pinhole parameters [k1, k2, p1, p2, k3, k4, k5, k6, s1, s2, s3, s4].

set_projection_mode(value: str) None#

Sets projection model of the camera prim to perspective or orthographic.

Parameters:

value – “perspective” or “orthographic”.

set_projection_type(value: str) None#

[DEPRECATED] Sets the cameraProjectionType property of the camera prim.

Parameters:

value – Name of the projection type to apply, or “pinhole” to remove any distortion schemas and unset omni:lensdistortion:model.

set_rad_tan_thin_prism_properties(
nominal_height: float | None = None,
nominal_width: float | None = None,
optical_center: tuple[float, float] | None = None,
max_fov: float | None = None,
distortion_coefficients: Sequence[float] | None = None,
) None#

Applies Radial-Tangential Thin Prism lens distortion model to the camera prim, then sets distortion parameters.

Parameters:
  • nominal_height – Height of the calibrated sensor.

  • nominal_width – Width of the calibrated sensor.

  • optical_center – Optical center (x, y).

  • max_fov – Maximum field of view in degrees.

  • distortion_coefficients – Distortion coefficients in the following order. [k0, k1, k2, k3, k4, k5] - radial distortion coefficients [p0, p1] - tangential distortion coefficients [s0, s1, s2, s3] - thin prism distortion coefficients.

set_rational_polynomial_properties(
nominal_width: float,
nominal_height: float,
optical_centre_x: float,
optical_centre_y: float,
max_fov: float | None,
distortion_model: Sequence[float],
) None#

[DEPRECATED] Sets OpenCV pinhole distortion parameters from rational polynomial coefficients.

Note

This method was designed to approximate the OpenCV pinhole distortion model using ftheta fisheye polynomial parameterization. The OpenCV pinhole distortion model is now directly supported, so this method uses that model directly.

Parameters:
  • nominal_width – Rendered Width (pixels).

  • nominal_height – Rendered Height (pixels).

  • optical_centre_x – Horizontal Render Position (pixels).

  • optical_centre_y – Vertical Render Position (pixels).

  • max_fov – DEPRECATED. Maximum field of view (pixels).

  • distortion_model – Rational polynomial distortion model coefficients (k1, k2, p1, p2, k3, k4, k5, k6, s1, s2, s3, s4).

set_resolution(
value: tuple[int, int],
maintain_square_pixels: bool = True,
) None#

Set the resolution of the camera sensor.

Checks and updates the apertures to maintain square pixels.

Parameters:
  • value – Width and height respectively.

  • maintain_square_pixels – If True, keep apertures in sync for square pixels.

set_shutter_properties(
delay_open: float | None = None,
delay_close: float | None = None,
) None#

Sets the shutter properties for motion blur control.

Parameters:
  • delay_open – Used with Motion Blur to control blur amount, increased values delay shutter opening.

  • delay_close – Used with Motion Blur to control blur amount, increased values forward the shutter close.

set_stereo_role(value: str) None#

Sets stereo role of the camera prim to mono, left or right.

Parameters:

value – “mono”, “left” or “right”.

set_vertical_aperture(
value: float,
maintain_square_pixels: bool = True,
) None#

Set vertical aperture (sensor height) in stage units and update horizontal for square pixels.

Only square pixels are supported; horizontal aperture is updated to match aspect ratio.

Parameters:
  • value – Vertical aperture in stage units.

  • maintain_square_pixels – If True, keep apertures in sync for square pixels.

set_visibility(visible: bool) None#

Set the visibility of the prim in stage.

Parameters:

visible – Flag to set the visibility of the USD prim in stage.

Example:

>>> # make prim not visible in the stage
>>> prim.set_visibility(visible=False)
set_world_pose(
position: Sequence[float] | None = None,
orientation: Sequence[float] | None = None,
camera_axes: str = 'world',
) None#

Sets prim’s pose with respect to the world’s frame.

The world’s frame is always at [0, 0, 0] with unity quaternion and is not the /World Prim.

Parameters:
  • position – Position in the world frame of the prim. shape is (3, ).

  • orientation – Quaternion orientation in the world frame of the prim. quaternion is scalar-first (w, x, y, z). shape is (4, ).

  • camera_axes – Camera axes. world is (+Z up, +X forward), ros is (+Y up, +Z forward), and usd is (+Y up and -Z forward).

Raises:

Exception – If camera_axes is not world, ros, or usd.

property name: str | None#

Name given to the prim when instantiating it.

Returns:

Name given to the prim when instantiating it. Otherwise None.

Whether the prim is a non-root articulation link.

Returns:

True if the prim itself is a non-root link.

Example:

>>> # for a wrapped articulation (where the root prim has the Physics Articulation Root property applied)
>>> prim.non_root_articulation_link
False
property prim: pxr.Usd.Prim#

USD Prim object that this object holds.

Returns:

USD Prim object that this object holds.

property prim_path: str#

Prim path in the stage.

Returns:

Prim path in the stage.

property supported_annotators: list[str]#

List of annotators supported by the camera.

Returns:

List of annotator names that can be attached to this camera.

class CameraView(
prim_paths_expr: str = None,
name: str = 'camera_prim_view',
camera_resolution: tuple[int, int] = (256, 256),
output_annotators: list[str] | None = None,
positions: ndarray | Tensor | array | None = None,
translations: ndarray | Tensor | array | None = None,
orientations: ndarray | Tensor | array | None = None,
scales: ndarray | Tensor | array | None = None,
visibilities: ndarray | Tensor | array | None = None,
reset_xform_properties: bool = True,
)#

Bases: XFormPrim

Provide high level functions to deal with tiled/batched data from cameras.

Annotator type - Channels - Dtype

"rgb" - 3 - uint8

"rgba" - 4 - uint8

"depth" / "distance_to_image_plane" - 1 - float32

"distance_to_camera" - 1 - float32

"normals" - 4 - float32

"motion_vectors" - 4 - float32

"semantic_segmentation" - 1 - uint32

"instance_segmentation_fast" - 1 - uint32

"instance_id_segmentation_fast" - 1 - uint32

Parameters:
  • prim_paths_expr – Prim paths regex to encapsulate all prims that match it. E.g.: “/World/Env[1-5]/Camera” will match /World/Env1/Camera, /World/Env2/Camera, etc. Additionally, a list of regex can be provided.

  • name – Short name to be used as a key by Scene class. Note: needs to be unique if the object is added to the Scene.

  • camera_resolution – Resolution of each sensor (width, height).

  • output_annotators – Annotator/sensor types to configure.

  • positions – Default positions in the world frame of the prim. Shape is (N, 3).

  • translations – Default translations in the local frame of the prims (with respect to its parent prims). Shape is (N, 3).

  • orientations – Default quaternion orientations in the world/local frame of the prim (depends if translation or position is specified). Quaternion is scalar-first (w, x, y, z). Shape is (N, 4).

  • scales – Local scales to be applied to the prim’s dimensions. Shape is (N, 3).

  • visibilities – Set to False for an invisible prim in the stage while rendering. Shape is (N,).

  • reset_xform_properties – True if the prims do not have the right set of xform properties (i.e: translate, orient and scale) ONLY and in that order. Set this parameter to False if the object was cloned using the cloner API in isaacsim.core.cloner.

Raises:
  • Exception – If translations and positions are defined at the same time.

  • Exception – No prim was matched using the prim_paths_expr provided.

apply_visual_materials(
visual_materials: 'VisualMaterial' | list['VisualMaterial'],
weaker_than_descendants: bool | list[bool] | None = None,
indices: np.ndarray | list | torch.Tensor | wp.array | None = None,
) None#

Apply visual material to the prims and optionally their prim descendants.

Parameters:
  • visual_materials – Visual materials to be applied to the prims. Currently supports PreviewSurface, OmniPBR and OmniGlass. If a list is provided then its size has to be equal the view’s size or indices size. If one material is provided it will be applied to all prims in the view.

  • weaker_than_descendants – True if the material shouldn’t override the descendants materials, otherwise False. If a list of visual materials is provided then a list has to be provided with the same size for this arg as well.

  • indices – Indices to specify which prims to manipulate. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:
  • Exception – length of visual materials != length of prims indexed

  • Exception – length of visual materials != length of weaker descendants bools arg

  • Exception – If the prim view is not valid.

Example:

>>> from isaacsim.core.api.materials import OmniGlass
>>>
>>> # create a dark-red glass visual material
>>> material = OmniGlass(
...     prim_path="/World/material/glass",  # path to the material prim to create
...     ior=1.25,
...     depth=0.001,
...     thin_walled=False,
...     color=np.array([0.5, 0.0, 0.0])
... )
>>> prims.apply_visual_materials(material)
destroy() None#

Destroy the CameraView by cleaning up the tiled sensor and calling the parent destructor.

get_applied_visual_materials(
indices: np.ndarray | list | torch.Tensor | wp.array | None = None,
) list['VisualMaterial']#

Get the current applied visual materials.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

A list of the current applied visual materials to the prims if its type is currently supported.

Raises:

Exception – If the prim view is not valid.

Example:

>>> # get all applied visual materials. Returned size is 5 for the example: 5 envs
>>> prims.get_applied_visual_materials()
[<isaacsim.core.api.materials.omni_glass.OmniGlass object at 0x7f829c165de0>,
 <isaacsim.core.api.materials.omni_glass.OmniGlass object at 0x7f829c165de0>,
 <isaacsim.core.api.materials.omni_glass.OmniGlass object at 0x7f829c165de0>,
 <isaacsim.core.api.materials.omni_glass.OmniGlass object at 0x7f829c165de0>,
 <isaacsim.core.api.materials.omni_glass.OmniGlass object at 0x7f829c165de0>]
>>>
>>> # get the applied visual materials for the first, middle and last of the 5 envs. Returned size is 3
>>> prims.get_applied_visual_materials(indices=np.array([0, 2, 4]))
[<isaacsim.core.api.materials.omni_glass.OmniGlass object at 0x7f829c165de0>,
 <isaacsim.core.api.materials.omni_glass.OmniGlass object at 0x7f829c165de0>,
 <isaacsim.core.api.materials.omni_glass.OmniGlass object at 0x7f829c165de0>]
get_aspect_ratios() float#

Calculate the aspect ratio of the cameras from the current resolution setting.

Returns:

The aspect ratio, defined as width divided by height.

get_data(
annotator_type: str,
*,
tiled: bool = False,
out: array | None = None,
) tuple[array, dict[str, Any]]#

Fetch the specified annotator/sensor data for all cameras as a batch of images or as a single tiled image.

Parameters:
  • annotator_type – Annotator/sensor type to fetch data from.

  • tiled – Whether to get annotator/sensor data as a single tiled image.

  • out – Pre-allocated array to fill with the fetched data.

Returns:

2-item tuple. The first item is an array containing the fetched data. If out is defined, its instance will be returned. The second item is a dictionary containing additional information according to the requested annotator/sensor type.

Raises:
  • ValueError – If the specified annotator type is not supported.

  • ValueError – If the specified annotator type is not configured when instantiating the object.

get_default_state() XFormPrimViewState#

Get the default states (positions and orientations) defined with the set_default_state method.

Returns:

The default state of the prims that is used after each reset.

Raises:

Exception – If the prim view is not valid.

Example:

>>> state = prims.get_default_state()
>>> state
<isaacsim.core.utils.types.XFormPrimViewState object at 0x7f82f73e3070>
>>> state.positions
[[ 1.5  -0.75  0.  ]
 [ 1.5   0.75  0.  ]
 [ 0.   -0.75  0.  ]
 [ 0.    0.75  0.  ]
 [-1.5  -0.75  0.  ]]
>>> state.orientations
[[1. 0. 0. 0.]
 [1. 0. 0. 0.]
 [1. 0. 0. 0.]
 [1. 0. 0. 0.]
 [1. 0. 0. 0.]]
get_depth(out: object = None) Tensor#

Get the depth data for all cameras as a batch of images (num_cameras, height, width, 1).

Parameters:

out – Pre-allocated tensor to fill with the depth data.

Returns:

The depth data for each camera. Shape is (num_cameras, height, width, 1) with type torch.float32.

Raises:

ValueError – If the distance_to_image_plane annotator type is not configured.

get_depth_tiled(
out: object = None,
device: str = 'cpu',
) ndarray | Tensor#

Fetch the depth data for all cameras as a single tiled image.

Parameters:
  • out – Pre-allocated array or tensor to fill with the depth data.

  • device – Device to return the data on (“cpu” or “cuda”).

Returns:

The tiled depth data for each camera.

Raises:

ValueError – If the distance_to_image_plane annotator type is not configured.

get_focal_lengths(
indices: ndarray | list | Tensor | array | None = None,
) list[float]#

Get the focal length for selected cameras.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

List containing the focal lengths of the cameras.

get_focus_distances(
indices: ndarray | list | Tensor | array | None = None,
) list[float]#

Get the focus distances for cameras specified by indices. If indices is None, get for all cameras.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

List containing the focus distances of the cameras.

get_horizontal_apertures(
indices: ndarray | list | Tensor | array | None = None,
) list[float]#

Get the horizontal apertures for cameras specified by indices. If indices is None, get for all cameras.

Emulates sensor/film width on a camera.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

List containing the horizontal apertures of the cameras.

get_lens_apertures(
indices: ndarray | list | Tensor | array | None = None,
) list[float]#

Get the lens apertures for cameras specified by indices. If indices is None, get for all cameras.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

List containing the lens apertures of the cameras.

get_local_poses(
indices: ndarray | list | Tensor | array | None = None,
camera_axes: str = 'world',
) tuple[ndarray, ndarray] | tuple[Tensor, Tensor] | tuple[indexedarray, indexedarray]#

Get prim poses in the view with respect to the local frame, the prim’s parent frame.

Parameters:
  • indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

  • camera_axes – The coordinate system to use (‘world’, ‘ros’, ‘usd’).

Returns:

Tuple where the first item contains positions in the local frame of the prims. Shape is (M, 3). The second item contains quaternion orientations in the local frame of the prims. Quaternion is scalar-first (w, x, y, z). Shape is (M, 4).

Raises:

Exception – If the provided camera_axes is not supported.

get_local_scales(
indices: ndarray | list | Tensor | array | None = None,
) ndarray | Tensor | indexedarray#

Get prim scales in the view with respect to the local frame (the parent’s frame).

Parameters:

indices – indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

scales applied to the prim’s dimensions in the local frame. shape is (M, 3).

Raises:

Exception – If the prim view is not valid.

Example:

>>> # get all prims scales with respect to the local frame.
>>> # Returned shape is (5, 3) for the example: 5 envs
>>> prims.get_local_scales()
[[1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]]
>>>
>>> # get only the prims scales with respect to the local frame for the first, middle and last of the 5 envs.
>>> # Returned shape is (3, 3) for the example: 3 envs selected
>>> prims.get_local_scales(indices=np.array([0, 2, 4]))
[[1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]]
get_projection_modes(
indices: ndarray | list | Tensor | array | None = None,
) list[str]#

Get the projection modes for cameras specified in indices. If indices is None, get for all cameras.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

List of projection modes (perspective, orthographic).

get_projection_types(
indices: ndarray | list | Tensor | array | None = None,
) list[str]#

Get the projection types for cameras specified by indices. If indices is None, get for all cameras.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

List of projection types (pinhole, fisheyeOrthographic, fisheyeEquidistant, fisheyeEquisolid, fisheyePolynomial or fisheyeSpherical).

get_render_product_path() str#

Retrieve the file path of the render product associated with the tiled sensor.

Returns:

The render product path.

get_resolutions() tuple[int, int]#

Retrieve the current resolution setting for all cameras.

Returns:

The resolution of the cameras.

get_rgb(out: object = None) Tensor#

Get the RGB data for all cameras as a batch of images (num_cameras, height, width, 3).

Parameters:

out – Pre-allocated tensor to fill with the RGB data.

Returns:

The RGB data for each camera. Shape is (num_cameras, height, width, 3) with type torch.uint8.

Raises:

ValueError – If the RGB annotator type is not configured.

get_rgb_tiled(
out: object = None,
device: str = 'cpu',
) ndarray | Tensor#

Fetch the RGB data for all cameras as a single tiled image.

Parameters:
  • out – Pre-allocated array or tensor to fill with the RGB data.

  • device – Device to return the data on (“cpu” or “cuda”).

Returns:

The tiled RGB data for each camera. Depth channel is excluded if present.

Raises:

ValueError – If the RGB annotator type is not configured.

get_shutter_properties(
indices: ndarray | list | Tensor | array | None = None,
) list[tuple[float, float]]#

Get the (delay_open, delay_close) of shutter for cameras specified in indices.

If indices is None, get for all cameras.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

List of tuple (delay_open, delay_close).

get_stereo_roles(
indices: ndarray | list | Tensor | array | None = None,
) list[str]#

Get the stereo roles for cameras specified in indices. If indices is None, get for all cameras.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

List of stereo roles (mono, left, right).

get_vertical_apertures(
indices: ndarray | list | Tensor | array | None = None,
) list[float]#

Get the vertical apertures for cameras specified by indices. If indices is None, get for all cameras.

Emulates sensor/film height on a camera.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

List containing the vertical apertures of the cameras.

get_visibilities(
indices: ndarray | list | Tensor | array | None = None,
) ndarray | Tensor | indexedarray#

Return the current visibilities of the prims in stage.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

Shape (M,) with type bool, where each item holds True if the prim is visible in stage. False otherwise.

Raises:

Exception – If the prim view is not valid.

Example:

>>> # get all visibilities. Returned shape is (5,) for the example: 5 envs
>>> prims.get_visibilities()
[ True  True  True  True  True]
>>>
>>> # get the visibilities for the first, middle and last of the 5 envs. Returned shape is (3,)
>>> prims.get_visibilities(indices=np.array([0, 2, 4]))
[ True  True  True]
get_world_poses(
indices: ndarray | list | Tensor | array | None = None,
camera_axes: str = 'world',
usd: bool = True,
) tuple[ndarray, ndarray] | tuple[Tensor, Tensor] | tuple[indexedarray, indexedarray]#

Get the poses of the prims in the view with respect to the world’s frame.

Parameters:
  • indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

  • camera_axes – The coordinate system to use (‘world’, ‘ros’, ‘usd’).

  • usd – True to query from USD. Otherwise False to query from Fabric data.

Returns:

Tuple where the first item contains positions in the world frame of the prims. Shape is (M, 3). The second item contains quaternion orientations in the world frame of the prims. Quaternion is scalar-first (w, x, y, z). Shape is (M, 4).

Raises:

Exception – If the provided camera_axes is not supported.

get_world_scales(
indices: ndarray | list | Tensor | array | None = None,
) ndarray | Tensor | indexedarray#

Get prim scales in the view with respect to the world’s frame.

Parameters:

indices – indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

scales applied to the prim’s dimensions in the world frame. shape is (M, 3).

Raises:

Exception – If the prim view is not valid.

Example:

>>> # get all prims scales with respect to the world's frame.
>>> # Returned shape is (5, 3) for the example: 5 envs
>>> prims.get_world_scales()
[[1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]]
>>>
>>> # get only the prims scales with respect to the world's frame for the first, middle and last of the 5 envs.
>>> # Returned shape is (3, 3) for the example: 3 envs selected
>>> prims.get_world_scales(indices=np.array([0, 2, 4]))
[[1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]]
initialize(
physics_sim_view: omni.physics.tensors.SimulationView = None,
) None#

Refresh backend references from SimulationManager for this prim view.

Note

This class does not create class-specific PhysX tensor API data.

Parameters:

physics_sim_view – Current physics simulation view accepted for API compatibility.

Example:

>>> prims.initialize()
is_valid(
indices: ndarray | list | Tensor | array | None = None,
) bool#

Check whether the prim view is valid.

Parameters:

indices – Indices accepted for API compatibility. The current view validity is returned regardless of indices.

Returns:

True if the prim view has not been invalidated by destroy or matching prim deletion. False otherwise.

Example:

>>> prims.is_valid()
True
is_visual_material_applied(
indices: ndarray | list | Tensor | array | None = None,
) list[bool]#

Check if there is a visual material applied.

Parameters:

indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Returns:

True if there is a visual material applied to the corresponding prim in the view. False otherwise.

Raises:

Exception – If the prim view is not valid.

Example:

>>> # given a visual material that is applied only to the first and the last environment
>>> prims.is_visual_material_applied()
[True, False, False, False, True]
>>>
>>> # check for the first, middle and last of the 5 envs
>>> prims.is_visual_material_applied(indices=np.array([0, 2, 4]))
[True, False, True]
post_reset() None#

Trigger post-reset handling for the prim view.

Example:

>>> prims.post_reset()
set_default_state(
positions: ndarray | Tensor | array | None = None,
orientations: ndarray | Tensor | array | None = None,
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the default state of the prims (positions and orientations), that will be used after each reset.

Note

The default states will be set during post-reset (e.g., calling .post_reset() or world.reset() methods)

Parameters:
  • positions – Positions in the world frame of the prim. shape is (M, 3).

  • orientations – Quaternion orientations in the world frame of the prim. quaternion is scalar-first (w, x, y, z). shape is (M, 4).

  • indices – Indices to specify which prims to manipulate. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

Exception – If the prim view is not valid.

Example:

>>> # configure default states for all prims
>>> positions = np.zeros((num_envs, 3))
>>> positions[:, 0] = np.arange(num_envs)
>>> orientations = np.tile(np.array([1.0, 0.0, 0.0, 0.0]), (num_envs, 1))
>>> prims.set_default_state(positions=positions, orientations=orientations)
>>>
>>> # set default states during post-reset
>>> prims.post_reset()
set_focal_lengths(
values: list[float],
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the focal length for cameras specified by indices. If indices is None, set for all cameras.

Parameters:
  • values – List containing the focal lengths to set for the cameras. Length of values must match length of indices.

  • indices – Indices to specify which prims to query. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

ValueError – If the length of values does not match the length of indices.

set_focus_distances(
values: list[float],
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the focus distance for cameras specified by indices. If indices is None, set for all cameras.

Parameters:
  • values – List containing the focus distances to set for the cameras. Length of values must match length of indices.

  • indices – Indices to specify which prims to set. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

ValueError – If the length of values does not match the length of indices.

set_horizontal_apertures(
values: list[float],
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the horizontal apertures for cameras specified by indices. If indices is None, set for all cameras.

Parameters:
  • values – List containing the horizontal apertures to set for the cameras. Length of values must match length of indices.

  • indices – Indices to specify which prims to set. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

ValueError – If the length of values does not match the length of indices.

set_lens_apertures(
values: list[float],
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the lens apertures for cameras specified by indices. If indices is None, set for all cameras.

Controls Distance Blurring. Lower Numbers decrease focus range, larger numbers increase it.

Parameters:
  • values – List containing the lens apertures to set for the cameras. Length of values must match length of indices.

  • indices – Indices to specify which prims to set. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

ValueError – If the length of values does not match the length of indices.

set_local_poses(
positions: ndarray | Tensor | array | None = None,
orientations: ndarray | Tensor | array | None = None,
indices: ndarray | list | Tensor | array | None = None,
camera_axes: str = 'world',
) None#

Set the local poses for selected cameras using the requested camera coordinate system.

Parameters:
  • positions – New positions for the cameras.

  • orientations – New orientations for the cameras.

  • indices – Indices of cameras to update.

  • camera_axes – The coordinate system to use (‘world’, ‘ros’, ‘usd’).

Raises:
  • Exception – If the provided camera_axes is not supported.

  • TypeError – If orientations is not a NumPy array, torch.Tensor, or Warp array.

set_local_scales(
scales: ndarray | Tensor | array | None,
indices: ndarray | list | Tensor | array | None = None,
) None#

Set prim scales in the view with respect to the local frame (the prim’s parent frame).

Parameters:
  • scales – scales to be applied to the prim’s dimensions in the view. shape is (M, 3).

  • indices – indices to specify which prims to manipulate. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

Exception – If the prim view is not valid.

Example:

>>> # set the scale for all prims. Since there are 5 envs, the scale is repeated 5 times
>>> scales = np.tile(np.array([1.0, 0.75, 0.5]), (num_envs, 1))
>>> prims.set_local_scales(scales)
>>>
>>> # set the scale for the first, middle and last of the 5 envs
>>> scales = np.tile(np.array([1.0, 0.75, 0.5]), (3, 1))
>>> prims.set_local_scales(scales, indices=np.array([0, 2, 4]))
set_projection_modes(
values: list[str],
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the projection modes for cameras specified in indices. If indices is None, set for all cameras.

Parameters:
  • values – List of projection modes (perspective, orthographic). Length of values must match length of indices.

  • indices – Indices to specify which prims to set. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

ValueError – If length of values does not match length of indices.

set_projection_types(
values: list[str],
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the projection types for cameras specified in indices. If indices is None, set for all cameras.

Parameters:
  • values – List of projection types (pinhole, fisheyeOrthographic, fisheyeEquidistant, fisheyeEquisolid, fisheyePolynomial or fisheyeSpherical). Length of values must match length of indices.

  • indices – Indices to specify which prims to set. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

ValueError – If length of values does not match length of indices.

set_resolutions(resolution: tuple[int, int]) None#

Set the resolution for all cameras and update the tiled sensor configuration when it changes.

Parameters:

resolution – Resolution to apply to all cameras.

set_shutter_properties(
values: list[tuple[float, float]],
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the (delay_open, delay_close) of shutter for cameras specified in indices.

If indices is None, set for all cameras.

Parameters:
  • values – List of tuple (delay_open, delay_close). Length of values must match length of indices.

  • indices – Indices to specify which prims to set. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

ValueError – If length of values does not match length of indices.

set_stereo_roles(
values: list[str],
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the stereo roles for cameras specified in indices. If indices is None, set for all cameras.

Parameters:
  • values – List of stereo roles (mono, left, right). Length of values must match length of indices.

  • indices – Indices to specify which prims to set. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

ValueError – If length of values does not match length of indices.

set_vertical_apertures(
values: list[float],
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the vertical apertures for cameras specified by indices. If indices is None, set for all cameras.

Emulates sensor/film height on a camera.

Parameters:
  • values – List containing the vertical apertures to set for the cameras. Length of values must match length of indices.

  • indices – Indices to specify which prims to set. Shape (M,). Where M <= size of the encapsulated prims in the view.

Raises:

ValueError – If the length of values does not match the length of indices.

set_visibilities(
visibilities: ndarray | Tensor | array,
indices: ndarray | list | Tensor | array | None = None,
) None#

Set the visibilities of the prims in stage.

Parameters:
  • visibilities – Flag to set the visibilities of the USD prims in stage. Shape (M,). Where M <= size of the encapsulated prims in the view.

  • indices – Indices to specify which prims to manipulate. Shape (M,).

Raises:

Exception – If the prim view is not valid.

Example:

>>> # make all prims not visible in the stage
>>> prims.set_visibilities(visibilities=[False] * num_envs)
set_world_poses(
positions: ndarray | Tensor | array | None = None,
orientations: ndarray | Tensor | array | None = None,
indices: ndarray | list | Tensor | array | None = None,
camera_axes: str = 'world',
usd: bool = True,
) None#

Set the world poses for selected cameras using the requested camera coordinate system.

Parameters:
  • positions – New positions for the cameras.

  • orientations – New orientations for the cameras.

  • indices – Indices of cameras to update.

  • camera_axes – The coordinate system to use (‘world’, ‘ros’, ‘usd’).

  • usd – True to set poses in USD. Otherwise False to set poses in Fabric data.

Raises:
  • Exception – If the provided camera_axes is not supported.

  • TypeError – If orientations is not a NumPy array, torch.Tensor, or Warp array.

property count: int#

Number of prims encapsulated in this view.

Returns:

The number of prims encapsulated in this view.

Example:

>>> prims.count
5
property initialized: bool#

Whether a physics simulation view is available for the prim view.

Returns:

True if a physics simulation view is available from SimulationManager. False otherwise.

Example:

>>> # given an active physics simulation view
>>> prims.initialized
True

True if the prim corresponds to a non root link in an articulation.

Returns:

True if the prim corresponds to a non root link in an articulation. Otherwise False.

property name: str#

Name given to the prims view when instantiating it.

Returns:

The name given to the prims view when instantiating it.

property prim_paths: list[str]#

Prim paths in the stage encapsulated in this view.

Returns:

The prim paths in the stage encapsulated in this view.

Example:

>>> prims.prim_paths
['/World/envs/env_0', '/World/envs/env_1', '/World/envs/env_2', '/World/envs/env_3',
 '/World/envs/env_4']
property prims: list[pxr.Usd.Prim]#

USD Prim objects encapsulated in this view.

Returns:

The USD Prim objects encapsulated in this view.

Example:

>>> prims.prims
[Usd.Prim(</World/envs/env_0>), Usd.Prim(</World/envs/env_1>), Usd.Prim(</World/envs/env_2>),
 Usd.Prim(</World/envs/env_3>), Usd.Prim(</World/envs/env_4>)]