mani_skill.sensors.camera#

Attributes#

T

Classes#

Camera

Implementation of the Camera sensor which uses the sapien Camera.

CameraConfig

Functions#

camera_observations_to_images(observations[, max_depth])

Parse images from camera observations.

normalize_depth(depth[, min_depth, max_depth])

parse_sensor_configs(sensor_configs)

update_sensor_configs_from_dict(sensor_configs, ...)

Module Contents#

class mani_skill.sensors.camera.Camera(camera_config, scene, articulation=None)[source]#

Bases: mani_skill.sensors.base_sensor.BaseSensor

Implementation of the Camera sensor which uses the sapien Camera.

Parameters:
capture()[source]#

Captures sensor data and prepares it for it to be then retrieved via get_obs for observations and get_image for a visualizable image.

Some sensors like rgbd cameras need to take a picture just once after each call to scene.update_render. Generally this should also be a non-blocking function if possible.

get_images(obs)[source]#

This returns the data of the sensor visualized as an image (rgb array of shape (B, H, W, 3)). This should not be used for generating agent observations. For example lidar data can be visualized as an image but should not be in a image format (H, W, 3) when being used by an agent.

Parameters:

obs (dict[str, torch.Tensor])

Return type:

dict[str, torch.Tensor]

get_obs(rgb=True, depth=True, position=True, segmentation=True, normal=False, albedo=False, apply_texture_transforms=True)[source]#

Retrieves captured sensor data as an observation for use by an agent.

Parameters:
  • rgb (bool)

  • depth (bool)

  • position (bool)

  • segmentation (bool)

  • normal (bool)

  • albedo (bool)

  • apply_texture_transforms (bool)

get_params()[source]#

Get parameters for this sensor. Should return a dictionary with keys mapping to torch.Tensor values

_shader_config[source]#
config: CameraConfig[source]#
class mani_skill.sensors.camera.CameraConfig[source]#

Bases: mani_skill.sensors.base_sensor.BaseSensorConfig

__post_init__()[source]#
__repr__()[source]#
Return type:

str

entity_uid: str | None = None[source]#

unique id of the entity to mount the camera. Defaults to None. Only used by agent classes that want to define mounted cameras.

far: float = 100[source]#

far plane of the camera

fov: float | None = None[source]#

The field of view of the camera. Either fov or intrinsic must be given

height: int[source]#

height of the camera

intrinsic: mani_skill.utils.structs.types.Array | None = None[source]#

intrinsics matrix of the camera. Either fov or intrinsic must be given

mount: mani_skill.utils.structs.Actor | mani_skill.utils.structs.Link | None = None[source]#

the Actor or Link to mount the camera on top of. This means the global pose of the mounted camera is now mount.pose * local_pose

near: float = 0.01[source]#

near plane of the camera

pose: mani_skill.utils.structs.pose.Pose | sapien.Pose[source]#

Pose of the camera

shader_config: mani_skill.render.ShaderConfig | None = None[source]#

The shader config to use for rendering. If None, the shader_pack will be used to search amongst prebuilt shader configs to create a ShaderConfig.

shader_pack: str = 'minimal'[source]#

The shader to use for rendering. Defaults to “minimal” which is the fastest rendering system with minimal GPU memory usage. There is also default and rt.

uid: str[source]#

unique id of the camera

Type:

uid (str)

width: int[source]#

width of the camera

mani_skill.sensors.camera.camera_observations_to_images(observations, max_depth=None)[source]#

Parse images from camera observations.

Parameters:

observations (dict[str, torch.Tensor])

Return type:

dict[str, torch.Tensor]

mani_skill.sensors.camera.normalize_depth(depth, min_depth=0, max_depth=None)[source]#
mani_skill.sensors.camera.parse_sensor_configs(sensor_configs)[source]#
Parameters:

sensor_configs (Union[Sequence[T], dict[str, T], T])

Return type:

dict[str, T]

mani_skill.sensors.camera.update_sensor_configs_from_dict(sensor_configs, config_dict)[source]#
Parameters:
  • sensor_configs (dict[str, T])

  • config_dict (dict[str, dict])

mani_skill.sensors.camera.T[source]#