Skip to content
Calder Phillips-Grafflin edited this page May 1, 2014 · 12 revisions

Overview

Image data is a special case for many thing in ROS - images are unusually large compared to most messages, they're usually not as time-sensitive as control commands or feedback, and there's usually plenty of processing power available to work with them. More importantly, however, they are distinctly more compressible than most ROS data - enough so that ROS has an entire framework, image_transport, dedicated to providing drop-in image compression/decompression.

In keeping with this, our relay software provides special-purpose nodes that combine the network behavior of the generic topic relay with the high-performance image compression of image_transport.

However - before setting up a relay, you need to know if you're working with image data or camera data. The distinction may sound a bit academic - after all, they're both images! However, the difference is very practical: camera data has an accompanying camera_info topic, image data does not. Most users of camera data will want (and usually need) both the image and camera_info data, which means both topics must be relayed together. The camera relay discussed below provides an automatic way not only to relay both image and camera_info topics, but also to ensure that they are properly synchronized at the endpoint.

Service-based relays

Setting up a relay for an image topic

Startpoint

The image topic startpoint node is request_image_link_startpoint in the opportunistic_link package. This node requires 2 parameters to be set:

  • image_topic - the name of the original image topic you want to relay, such as /camera/rgb/image

  • data_service - the name of the service used to forward messages between the startpoint and endpoint, such as /camera/rgb/image/data

Endpoint

The image topic endpoint node is request_image_link_endpoint in the opportunistic_link package. This node requires 8 parameters to be set:

  • relay_topic - the name of the original relay image topic, such as /relay/camera/rgb/image

  • data_service - the name of the service used to forward messages between the startpoint and endpoint, such as /camera/rgb/image/data

  • quality_ctrl - the name of the service used to set JPEG compression quality (ranging between 0 "worst" to 100 "best", such as /camera/rgb/image/quality

  • default_quality - the default JPEG compression quality. The default, 50, provides a good balance between visual quality and data rate

  • rate_ctrl - the name of the service used by other nodes to control the rate at which data is republished over the link, such as /camera/rgb/image/rate

  • default_rate - the default rate, in hz, to republish data. The default value, infinity, means immediate republishing of new data, while the value zero means that republishing is paused

  • latched - selects if the publisher should latch the last message published, which means that the last message will be available to all future subscribers

  • override_timestamps - selects if the publisher should reset the message timestamps to the time of receipt. This is useful over particularly high-latency or low-rate lengths where the time delay between transmission and receipt may be too long for TF.

Setting up a relay for a camera

Startpoint

The camera topic startpoint node is request_camera_link_startpoint in the opportunistic_link package. This node requires 2 parameters to be set:

  • camera_topic - the name of the original camera topic you want to relay, such as /camera/rgb/image

  • data_service - the name of the service used to forward messages between the startpoint and endpoint, such as /camera/rgb/image/data

Endpoint

The camera topic endpoint node is request_camera_link_endpoint in the opportunistic_link package. This node requires 8 parameters to be set:

  • relay_topic - the name of the original relay camera topic, such as /relay/camera/rgb/image

  • data_service - the name of the service used to forward messages between the startpoint and endpoint, such as /camera/rgb/image/data

  • quality_ctrl - the name of the service used to set JPEG compression quality (ranging between 0 "worst" to 100 "best", such as /camera/rgb/image/quality

  • default_quality - the default JPEG compression quality. The default, 50, provides a good balance between visual quality and data rate

  • rate_ctrl - the name of the service used by other nodes to control the rate at which data is republished over the link, such as '/camera/rgb/image/rate`

  • default_rate - the default rate, in hz, to republish data. The default value, infinity, means immediate republishing of new data, while the value zero means that republishing is paused

  • latched - selects if the publisher should latch the last message published, which means that the last message will be available to all future subscribers

  • override_timestamps - selects if the publisher should reset the message timestamps to the time of receipt. This is useful over particularly high-latency or low-rate lengths where the time delay between transmission and receipt may be too long for TF.

Other relay types

A similar set of image/camera relays is provided which uses topics internally for data transfer. Some of the basic parameters are similar, but a number of them are different to handle the setup of the internal topic-based link.

Clone this wiki locally