Wiki

relay

relay is ROS node that subscribes to a topic and republishes all incoming data to another topic. It can work with any message type.

relay is part of the topic_tools package.

relay usage

relay <intopic> [outtopic]

Stealth mode

New in Lunar

This is almost the same as a normal relay but it relays only if the topic specified by param ~monitor_topic is being subscribed by any other nodes except itself.

When input topic of relay and monitor topic are pointing to the same topic (this is the default configuration), the relay node subscribes input topic only when other nodes also subscribe the input topic. It looks like relay node subscribes without increment subscription count.

This feature is useful for publishing topics for visualization with lazy transport (e.g. nodelet_lazy in nodelet_topic_tools ). For example, lazy-transport-enabled nodes don't subscribe input topics unless other nodes subscribe the output topics of the nodes, but some nodes are expected to always subscribe topics (e.g. RViZ) and this breaks "laziness" of the nodes. Putting relay node with stealth mode between RViZ and the lazy node will solve this issue.

Parameters

~unreliable (bool, default: False)

~lazy (bool, default: False) ~stealth (bool, default: False) ~monitor_topic (string, default: same as intopic) ~monitor_rate (double, default: 1.0)

Wiki: topic_tools/relay (last edited 2017-10-31 22:25:39 by DirkThomas)