Skip to main content

get_image

Signature:

BoosterRobot.get_image(camera_id: str = "", img_type: ImageType = "rgb") -> AnyImage

Description:

Get the most recent frame of RGB or depth image.

Parameters:

Parameter

Type

Default

Description

camera_id

str

""

Camera ID; leave empty to use the default camera. For the available IDs, refer to the camera sensors returned by "list_sensors".

img_type

ImageType

"rgb"

Image type, see "Perception and State Data / ImageType".

Returns:

AnyImage, see "Perception and State Data / AnyImage"

Raises:

ValueError: img_type is not a supported image type.

DataNotReadyError: No corresponding image was obtained within the timeout period.

Example:

from boosteros.robots.booster import BoosterRobot

robot = BoosterRobot()
image = robot.get_image(img_type="rgb")
print(image.width, image.height)
# Example output: 320 240