Skip to main content

ZenohCamera

Inherits from: Camera No class docstring.

Inherited methods

  • From Camera: getData, getCameraIntrinsics, setCameraIntrinsics, getCameraSettings, setCameraSettings

init

ZenohCamera.__init__(topic, shape = None, dtype = np.uint8, queue_length = 2, zenoh_config = None, auto_parse_ros2 = True)
Initialize ZenohCamera with direct zenoh usage
Arguments
topic (str)
str
required
Zenoh topic to subscribe to
shape (tuple, optional)
tuple, optional
Shape of the image (height, width, channels). If None and auto_parse_ros2=True, will be extracted from ROS2 message
dtype (np.dtype)
np.dtype
Data type of the image data
queue_length (int)
int
Maximum size of the image queue
zenoh_config (dict, optional)
dict, optional
Zenoh configuration options
auto_parse_ros2 (bool)
bool
Whether to automatically parse ROS2 sensor_msgs/Image messages

from_ros2_topic

ZenohCamera.from_ros2_topic(topic, queue_length = 2, zenoh_config = None)
Create a ZenohCamera configured for ROS2 sensor_msgs/Image messages. This method creates a camera that will automatically parse the ROS2 message format and extract height, width, encoding, and image data.
Arguments
topic (str)
str
required
Zenoh topic to subscribe to (should carry ROS2 sensor_msgs/Image)
queue_length (int)
int
Maximum size of the image queue
zenoh_config (dict, optional)
dict, optional
Zenoh configuration options
Returns
ZenohCamera
Configured camera instance

getImage

ZenohCamera.getImage()
Get the latest image from the queue
Returns
Image
The latest image, or None if no image is available

close

ZenohCamera.close()
Close the zenoh session and cleanup resources