Image

For clients to use the image service.

exception bosdyn.client.image.ImageResponseError(response, error_message=None)[source]

Bases: bosdyn.client.exceptions.ResponseError

General class of errors for Image service.

exception bosdyn.client.image.UnknownImageSourceError(response, error_message=None)[source]

Bases: bosdyn.client.image.ImageResponseError

System cannot find the requested image source name.

exception bosdyn.client.image.SourceDataError(response, error_message=None)[source]

Bases: bosdyn.client.image.ImageResponseError

System cannot generate the ImageSource at this time.

exception bosdyn.client.image.ImageDataError(response, error_message=None)[source]

Bases: bosdyn.client.image.ImageResponseError

System cannot generate image data at this time.

class bosdyn.client.image.ImageClient[source]

Bases: bosdyn.client.common.BaseClient

Client for the image service.

default_service_name = 'image'
service_type = 'bosdyn.api.ImageService'
list_image_sources(**kwargs)[source]

Obtain the list of ImageSources.

Returns

A list of the different image sources as strings.

Raises

RpcError – Problem communicating with the robot.

list_image_sources_async(**kwargs)[source]

Async version of list_image_sources()

get_image_from_sources(image_sources, **kwargs)[source]

Obtain images from sources using default parameters.

Parameters

image_sources (list of strings) – The different image sources to request images from.

Returns

A list of image responses for each of the requested sources.

Raises

RpcError – Problem communicating with the robot.

get_image_from_sources_async(image_sources, **kwargs)[source]

Obtain images from sources using default parameters.

get_image(image_requests, **kwargs)[source]

Obtain the set of images from the robot.

Parameters

image_requests (list of ImageRequest) – A list of the ImageRequest protobuf messages which specify which images to collect.

Returns

A list of image responses for each of the requested sources.

Raises

RpcError – Problem communicating with the robot.

get_image_async(image_requests, **kwargs)[source]

Async version of get_image()

bosdyn.client.image.build_image_request(image_source_name, quality_percent=75, image_format=0)[source]

Helper function which builds an ImageRequest from an image source name.

By default the robot will choose an appropriate format - such as JPEG for visual images, or RAW for depth images. Clients can override image_format in those cases.

Parameters
  • image_source_name (string) – The image source to query.

  • quality_percent (int) – The image quality from [0,100] (percent-value).

  • image_format (image_pb2.Image.Format) – The type of format for the image data, such as JPEG, RAW, or RLE.

Returns

The ImageRequest protobuf message for the given parameters.