add stealth mode for topic_tools/relay#1155
Conversation
|
This seems reasonable to me. 👍 |
dirk-thomas
left a comment
There was a problem hiding this comment.
The new test doesn't seem to be registered anywhere and therefore does not seem to be run?
tools/topic_tools/src/relay.cpp
Outdated
|
|
||
| void unsubscribe() | ||
| { | ||
| ROS_DEBUG("unsubscribe"); |
There was a problem hiding this comment.
Should these debug messages be removed?
f326602 to
1d428c1
Compare
|
@mikepurvis Thanks for a warm comment! 👍 @dirk-thomas Thanks for review and nice catch! Registered new test and removed debug logs. |
|
Looks good to me: http://build.ros.org/job/Lpr__ros_comm__ubuntu_xenial_amd64/481/testReport/__main__/TestRelayStealth/ Thank you for the patch. Please add some documentation about this new feature to the wiki page. |
|
@dirk-thomas Sorry for late, updated documentation http://wiki.ros.org/topic_tools/relay 👍 |
|
Thank you for adding the docs. I added a note that this feature is new in Lunar (http://wiki.ros.org/action/diff/topic_tools/relay?action=diff&rev1=18&rev2=19). |
|
@dirk-thomas Thank you too! |
This PR is for adding "stealth mode" to
topic_tools/relaynode.This is almost the same as a normal relay but it relays only if topic specified by param
~monitor_topicis being subscribed by any other nodes except itself.When input topic of relay and monitor topic are pointing to the same topic (this is by default), it looks like the relay node subscribes input topic only when other nodes also subscribe the input topic, which means subscribing without increment subscription count.
This feature is useful for publishing topic for visualization with lazy transport (c.f. https://github.com/ros/nodelet_core/blob/indigo-devel/nodelet_topic_tools/include/nodelet_topic_tools/nodelet_lazy.h ).
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.By putting
relaynode with stealth mode betweenRViZand lazy node, this issue will be solved.