Skip to content

Sensor and Camera Options

SensorsOptions and CamerasOptions are the sensors_options and cameras_options fields of a config. Each holds named children: one SensorOptions or CameraOptions per sensor or camera, keyed by the name the env exposes it under (env.sensors[...], env.cameras[...]). A SensorOptions wraps any Genesis sensor options (gs.sensors.*, or one of Eden's engine sensors) and says which entity and link to attach it to. The sensors and rendering guide explains each sensor and camera mode.

from eden.options.camera import CameraOptions, CamerasOptions
from eden.options.sensors import SensorOptions, SensorsOptions

Sensors

SensorOptions

SensorOptions(**data)

Bases: ConfigurableOptions

Configuration for a single sensor.

PARAMETER DESCRIPTION
sensor

The Genesis sensor options.

TYPE: SensorOptions | None

attach_entity_name

Name of the entity to attach the sensor to. Empty for static sensors.

TYPE: str

attach_link_name

Name of the link to attach the sensor to.

TYPE: str

track_link_names

Resolved at env build into the nested sensor's track_link_idx (global link indices) when that sensor model defines track_link_idx. Each entry is a scene entity_name (all links on that entity) or entity_name/link_name (one link). See Sensor for details.

TYPE: list[str]

filter_link_names

For contact sensors (gs.sensors.Contact / gs.sensors.ContactForce), resolved at env build into the nested sensor's filter_link_idx (global link indices): contacts whose counterpart link is one of these are ignored, as if that link were not touching. Same token grammar as track_link_names (entity_name for all its links, entity_name/link_name for one). See Sensor for details.

TYPE: list[str]

Examples:

IMU sensor attached to a robot link

>>> sensor_options = SensorOptions(
...     sensor=gs.sensors.IMU(
...         acc_noise=(0.01, 0.01, 0.01),
...     ),
...     attach_entity_name="robot",
...     attach_link_name="base_link",
... )
Source code in eden/options/options.py
def __init__(self, **data):
    # Seed type metadata as construction data so BaseModel validates it into
    # __pydantic_extra__ (no-op for extra="forbid" classes, which use
    # the serialization envelope instead).
    data.update(option_metadata(self))
    # NOTE: all of the option modifications/validations should be done in the __init__ method
    try:
        BaseModel.__init__(self, **data)
    except ValidationError as exc:
        # A misspelled field on an extra="forbid" class should teach the field set, not just
        # name the typo. Only rewritten when every error is extra_forbidden.
        enriched = _enrich_extra_forbidden(type(self), exc)
        if enriched is None:
            raise
        raise enriched from None

Attributes

sensor class-attribute instance-attribute

sensor: SensorOptions | None = None

attach_entity_name class-attribute instance-attribute

attach_entity_name: str = ''
attach_link_name: str = ''
track_link_names: list[str] = Field(default_factory=list)
filter_link_names: list[str] = Field(default_factory=list)

SensorsOptions

SensorsOptions(**data)

Bases: DynamicConfigurableOptions

Container for multiple named sensors in an environment.

Examples:

>>> sensors_options = SensorsOptions(
...     contact_sensor=SensorOptions(
...         sensor=gs.sensors.Contact(),
...         attach_entity_name="robot",
...         attach_link_name="end_effector",
...     ),
...     imu_sensor=SensorOptions(
...         sensor=gs.sensors.IMU(acc_noise=(0.01, 0.01, 0.01)),
...         attach_entity_name="robot",
...     ),
... )
Source code in eden/options/options.py
def __init__(self, **data):
    # Seed type metadata as construction data so BaseModel validates it into
    # __pydantic_extra__ (no-op for extra="forbid" classes, which use
    # the serialization envelope instead).
    data.update(option_metadata(self))
    # NOTE: all of the option modifications/validations should be done in the __init__ method
    try:
        BaseModel.__init__(self, **data)
    except ValidationError as exc:
        # A misspelled field on an extra="forbid" class should teach the field set, not just
        # name the typo. Only rewritten when every error is extra_forbidden.
        enriched = _enrich_extra_forbidden(type(self), exc)
        if enriched is None:
            raise
        raise enriched from None

Cameras

CameraOptions

CameraOptions(**data)

Bases: ConfigurableOptions

Configuration for a single camera.

PARAMETER DESCRIPTION
model

Camera model.

cam_pos

Camera position.

cam_lookat

Camera lookat.

cam_resolution

Camera resolution in (width, height).

cam_up

Camera up vector.

cam_intrinsic

Camera intrinsic matrix, used to set the camera's field of view and resolution. If provided, cam_fov and cam_resolution will be ignored.

cam_extrinsic

Camera extrinsic matrix, used to set the camera's position, lookat, and up. The extrinsic matrix is the inverse of the transform from the camera frame to the world frame. If provided, cam_pos, cam_lookat, and cam_up will be ignored.

cam_aperture

Camera aperture.

cam_fov

Vertical field of view, in degrees.

cam_near

Near clipping plane in meters. None leaves Genesis's default (rasterizer/batch renderer only).

cam_far

Far clipping plane in meters. None leaves Genesis's default (rasterizer/batch renderer only).

debug

Whether to enable debug mode.

follow_entity_name

Name of the entity to follow.

attach_entity_name

Name of the entity to attach the camera to.

attach_link_name

Name of the link to attach the camera to.

attach_offset

Offset of the camera from the link.

attach_quat

Quaternion of the camera from the link (w, x, y, z).

overlays

What :meth:~eden.entities.camera.Camera.render_rgb paints onto every frame after the renderer made it, in order: a background composite (BackgroundImageComposite for a backdrop image, SplatComposite for a splat env's Gaussian splat), then state the task tracks but the scene does not render, such as the ink on a whiteboard. Reaches the recording and anything else built on render_rgb; an overlay leaves the pixels a composite before it replaced. An overlay that reads the point cloud costs a second render of the view per frame. See :mod:eden.entities.camera_overlays.

sensor_options

Genesis sensor options (e.g. RasterizerCameraOptions, NyxCameraOptions). When provided, the camera uses scene.add_sensor() instead of scene.add_camera(). The sensor backend only supports RGB rendering; depth/segmentation/normal/pointcloud are not available. Fields pos/lookat/fov/res/up are auto-populated from cam_pos/cam_lookat/cam_fov/cam_resolution/cam_up during build if not explicitly set.

Source code in eden/options/options.py
def __init__(self, **data):
    # Seed type metadata as construction data so BaseModel validates it into
    # __pydantic_extra__ (no-op for extra="forbid" classes, which use
    # the serialization envelope instead).
    data.update(option_metadata(self))
    # NOTE: all of the option modifications/validations should be done in the __init__ method
    try:
        BaseModel.__init__(self, **data)
    except ValidationError as exc:
        # A misspelled field on an extra="forbid" class should teach the field set, not just
        # name the typo. Only rewritten when every error is extra_forbidden.
        enriched = _enrich_extra_forbidden(type(self), exc)
        if enriched is None:
            raise
        raise enriched from None

Attributes

model class-attribute instance-attribute

model: Literal['pinhole', 'thinlens'] = 'pinhole'

cam_pos class-attribute instance-attribute

cam_pos: Vec3FType = (1.5, 0.0, 1)

cam_lookat class-attribute instance-attribute

cam_lookat: Vec3FType = (0.0, 0.0, 0.5)

cam_resolution class-attribute instance-attribute

cam_resolution: Vec2IType = (720, 480)

cam_up class-attribute instance-attribute

cam_up: Vec3FType = (0.0, 0.0, 1.0)

cam_intrinsic class-attribute instance-attribute

cam_intrinsic: FloatArray[3, 3] | None = None

cam_extrinsic class-attribute instance-attribute

cam_extrinsic: FloatArray[4, 4] | None = None

cam_aperture class-attribute instance-attribute

cam_aperture: float = 2.0

cam_fov class-attribute instance-attribute

cam_fov: float = 80.0

cam_near class-attribute instance-attribute

cam_near: float | None = None

cam_far class-attribute instance-attribute

cam_far: float | None = None

debug class-attribute instance-attribute

debug: bool = False

follow_entity_name class-attribute instance-attribute

follow_entity_name: str = ''

attach_entity_name class-attribute instance-attribute

attach_entity_name: str = ''
attach_link_name: str = ''

attach_offset class-attribute instance-attribute

attach_offset: Vec3FType | None = None

attach_quat class-attribute instance-attribute

attach_quat: UnitVec4FType | None = None

overlays class-attribute instance-attribute

overlays: list[CameraOverlayOptions] = []

sensor_options class-attribute instance-attribute

sensor_options: Any | None = None

CamerasOptions

CamerasOptions(**data)

Bases: DynamicConfigurableOptions

Container mapping camera names to their :class:CameraOptions.

Source code in eden/options/camera.py
def __init__(self, **data):
    entity_data = {}
    for key, entity in data.items():
        if isinstance(entity, CameraOptions):
            entity_data[key] = entity
        else:
            entity_data[key] = CameraOptions(**entity)

    super().__init__(**entity_data)

Methods:

CameraOverlayOptions

CameraOverlayOptions(**data)

Bases: DynamicConfigurableOptions

One overlay a camera paints onto its RGB frames (:mod:eden.entities.camera_overlays).

Built with the overlay class's configure(), e.g. PlanePaintOverlay.configure(metric_name="drawing", color=(0, 0, 0)), which fills name with the overlay's registry key and carries its parameters as extras. Those are checked here, when name resolves: their names against the overlay's parameters, their types against the declared ones (converting as a declared field would, so a list read back from JSON is the declared tuple again), and their values by the overlay's check_parameters(). A typo or a bad value in a config file therefore fails in that file. An overlay whose module is not imported yet is checked when the camera is constructed.

PARAMETER DESCRIPTION
name

Registry key of the overlay in CAMERA_OVERLAY_REGISTRY.

Source code in eden/options/options.py
def __init__(self, **data):
    # Seed type metadata as construction data so BaseModel validates it into
    # __pydantic_extra__ (no-op for extra="forbid" classes, which use
    # the serialization envelope instead).
    data.update(option_metadata(self))
    # NOTE: all of the option modifications/validations should be done in the __init__ method
    try:
        BaseModel.__init__(self, **data)
    except ValidationError as exc:
        # A misspelled field on an extra="forbid" class should teach the field set, not just
        # name the typo. Only rewritten when every error is extra_forbidden.
        enriched = _enrich_extra_forbidden(type(self), exc)
        if enriched is None:
            raise
        raise enriched from None

Attributes

name class-attribute instance-attribute

name: str | None = None

The overlay classes themselves (PlanePaintOverlay, SplatComposite, ...) are on the entities page.

See also