camera

class real_robot.sensors.camera.Camera(camera_cfg: CameraConfig, *, record_bag_path: str | Path | None = None)[source]

Bases: object

Wrapper for RealSense camera (RSDevice)

get_extrinsic_matrix(pose: Pose | None = None) ndarray[source]

Returns a 4x4 extrinsic camera matrix in OpenCV format right(x), down(y), forward(z)

get_images(take_picture=False) dict[str, ndarray][source]

Get (raw) images from the camera. Takes ~300 us for 848x480 @ 60fps :return rgb: color image, [H, W, 3] np.uint8 array :return depth: depth image, [H, W, 1] np.float32 array :return ir_l: left IR image, [H, W] np.uint8 array :return ir_r: right IR image, [H, W] np.uint8 array

get_model_matrix(pose: Pose | None = None) ndarray[source]
Returns a 4x4 camera model matrix in OpenCV format

right(x), down(y), forward(z)

Note: this impl is different from sapien where the format is

right(x), up(y), back(z)

get_params()[source]

Get camera parameters.

property observation_space: Dict
property pose: Pose

Camera pose in world frame, following ROS frame conventions Format is forward(x), left(y) and up(z)

take_picture()[source]

Fetch images and camera pose from the camera

class real_robot.sensors.camera.CameraConfig(uid: str, device_sn: str | None = None, pose: Pose = Pose([0, 0, 0], [0.5, 0.5, -0.5, 0.5]), config: tuple[int, int, int] | dict[str, int | tuple[int, int, int]] | None = None, *, preset: str = 'Default', align_to: Literal['Color', 'Depth'] = 'Color', color_option_kwargs={}, depth_option_kwargs={}, json_file: str | Path | None = None, parent_pose_so_name: str | None = None)[source]

Bases: object

real_robot.sensors.camera.parse_camera_cfgs(camera_cfgs)[source]
real_robot.sensors.camera.update_camera_cfgs_from_dict(camera_cfgs: dict[str, CameraConfig], cfg_dict: dict[str, Any | dict[str, Any]])[source]