Skip to main content

ImageClient

Inherits from: ROSClient A ROS client for handling image messages. This class inherits from ROSClient and provides functionality for publishing and receiving image messages over ROS topics, with support for various image encodings and formats.

ImageClient

Initialize the image client.
required
Configuration dictionary for the client
defaults to None. Dictionary of agent parameters. Defaults to None.

decode_image

Decode image data from ROS message format.
required
Base64 encoded image data
required
Image height in pixels
required
Image width in pixels
required
Image encoding format. Supported formats:
  • ‘rgb8’: 8-bit RGB color
  • ‘bgr8’: 8-bit BGR color (converted to RGB)
  • ‘rgba8’: 8-bit RGBA color (converted to RGB)
  • ‘bgra8’: 8-bit BGRA color (converted to RGB)
  • ‘32FC1’: 32-bit floating point grayscale
Decoded image array in RGB format (for color images) or grayscale format (for ‘32FC1’). For RGB format, has shape (height, width, 3). For grayscale, has shape (height, width, 1).

publish_agent_image

publish_image

Publish an image to the configured topic.
required
Image data to publish

get_image

Get the most recent processed image.
The most recent image data, or None if no image is available