nodelet_core icon indicating copy to clipboard operation
nodelet_core copied to clipboard

does this tool support "relay" mode?

Open asimay opened this issue 8 years ago • 4 comments

does this tool support "relay" mode? if not, and can you add it?

asimay avatar Nov 25 '17 08:11 asimay

Hi @asimay, Could you expllain what you mean by "relay" mode? Do you want to create node/nodelet that subscribe to a topic and republishes the same data on another topic ?

mikaelarguedas avatar Nov 25 '17 20:11 mikaelarguedas

hi, @mikaelarguedas , dear, yes. I used topic_tools before, and find your tools, topic_tools has "relay" mode, and I want to know your package has this kind of mode or not? because I need to defined this kind of mode across files.

but 1 disadvantage of topic_tools relay mode is: it also copy the topic data, this will waste the resources of PC.

asimay avatar Nov 26 '17 02:11 asimay

Thanks for clarifying. Currently nodelet_topic_tools does not provide a relay nodelet.

It could be fairly easily implemented by providing a nodelet templated on the message type and taking input and output topic names as parameters (you can look at nodelet_mux.h or nodelet_throttle.h for examples of nodelets templated on message types.

Though it is recommended to remap topics (if it makes sense in the case of your application) rather than subscribing and republishing them, this allow to avoid serialization/deserialization put as well as unnecessary copies. Please see https://github.com/ros/roscpp_core/issues/31 for more information of cases where copies will be performed anyway.

mikaelarguedas avatar Nov 26 '17 17:11 mikaelarguedas

http://wiki.ros.org/cras_topic_tools provides a relay nodelet. The package is released, so simply sudo apt install ros-${ROS_DISTRO}-cras-topic-tools.

peci1 avatar Aug 16 '23 12:08 peci1