mani_skill.envs.utils.observations ================================== .. py:module:: mani_skill.envs.utils.observations Submodules ---------- .. toctree:: :maxdepth: 1 /api/mani_skill/envs/utils/observations/observations/index Attributes ---------- .. autoapisummary:: mani_skill.envs.utils.observations.ALL_VISUAL_TEXTURES Classes ------- .. autoapisummary:: mani_skill.envs.utils.observations.BaseSensor mani_skill.envs.utils.observations.BaseSensorConfig mani_skill.envs.utils.observations.Camera mani_skill.envs.utils.observations.CameraObsTextures mani_skill.envs.utils.observations.ObservationModeStruct Functions --------- .. autoapisummary:: mani_skill.envs.utils.observations.parse_obs_mode_to_struct mani_skill.envs.utils.observations.sensor_data_to_pointcloud Package Contents ---------------- .. py:class:: BaseSensor(config) Base class for all sensors .. py:method:: capture() 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. .. py:method:: get_images() :abstractmethod: 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. .. py:method:: get_obs(**kwargs) :abstractmethod: Retrieves captured sensor data as an observation for use by an agent. .. py:method:: get_params() :abstractmethod: Get parameters for this sensor. Should return a dictionary with keys mapping to torch.Tensor values .. py:method:: setup() Setup this sensor given the current scene. This is called during environment/scene reconfiguration. .. py:attribute:: config .. py:property:: uid .. py:class:: BaseSensorConfig .. py:attribute:: uid :type: str .. py:class:: Camera(camera_config, scene, articulation = None) Bases: :py:obj:`mani_skill.sensors.base_sensor.BaseSensor` Implementation of the Camera sensor which uses the sapien Camera. .. py:method:: capture() 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. .. py:method:: get_images(obs) 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. .. py:method:: get_obs(rgb = True, depth = True, position = True, segmentation = True, normal = False, albedo = False, apply_texture_transforms = True) Retrieves captured sensor data as an observation for use by an agent. .. py:method:: get_params() Get parameters for this sensor. Should return a dictionary with keys mapping to torch.Tensor values .. py:attribute:: config :type: CameraConfig .. py:class:: CameraObsTextures .. py:attribute:: albedo :type: bool .. py:attribute:: depth :type: bool .. py:attribute:: normal :type: bool .. py:attribute:: position :type: bool .. py:attribute:: rgb :type: bool .. py:attribute:: segmentation :type: bool .. py:class:: ObservationModeStruct A dataclass describing what observation data is being requested by the user .. py:attribute:: state :type: bool whether to include flattened state data which generally means including privileged information such as object poses .. py:attribute:: state_dict :type: bool whether to include state data which generally means including privileged information such as object poses .. py:property:: use_state whether or not the environment should return ground truth/privileged information such as object poses .. py:attribute:: visual :type: CameraObsTextures textures to capture from cameras .. py:function:: parse_obs_mode_to_struct(obs_mode) Given user supplied observation mode, return a struct with the relevant textures that are to be captured .. py:function:: sensor_data_to_pointcloud(observation, sensors) convert all camera data in sensor to pointcloud data .. py:data:: ALL_VISUAL_TEXTURES :value: ['rgb', 'depth', 'segmentation', 'position', 'normal', 'albedo'] set of all standard textures that can come from cameras