mani_skill.sensors ================== .. py:module:: mani_skill.sensors Submodules ---------- .. toctree:: :maxdepth: 1 /api/mani_skill/sensors/base_sensor/index /api/mani_skill/sensors/camera/index Classes ------- .. autoapisummary:: mani_skill.sensors.BaseSensor mani_skill.sensors.BaseSensorConfig mani_skill.sensors.Camera mani_skill.sensors.CameraConfig 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:: CameraConfig Bases: :py:obj:`mani_skill.sensors.base_sensor.BaseSensorConfig` .. py:method:: __post_init__() .. py:method:: __repr__() .. py:attribute:: entity_uid :type: Optional[str] :value: None unique id of the entity to mount the camera. Defaults to None. Only used by agent classes that want to define mounted cameras. .. py:attribute:: far :type: float :value: 100 far plane of the camera .. py:attribute:: fov :type: float :value: None The field of view of the camera. Either fov or intrinsic must be given .. py:attribute:: height :type: int height of the camera .. py:attribute:: intrinsic :type: mani_skill.utils.structs.types.Array :value: None intrinsics matrix of the camera. Either fov or intrinsic must be given .. py:attribute:: mount :type: Union[mani_skill.utils.structs.Actor, mani_skill.utils.structs.Link] :value: None 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 .. py:attribute:: near :type: float :value: 0.01 near plane of the camera .. py:attribute:: pose :type: mani_skill.utils.structs.pose.Pose Pose of the camera .. py:attribute:: shader_config :type: Optional[mani_skill.render.ShaderConfig] :value: None 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. .. py:attribute:: shader_pack :type: Optional[str] :value: 'minimal' 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``. .. py:attribute:: uid :type: str unique id of the camera :type: uid (str) .. py:attribute:: width :type: int width of the camera