[ros-users] Best practices for advertising topics, etc.

Patrick Bouffard bouffard at eecs.berkeley.edu
Tue Jan 25 19:00:37 UTC 2011


Is there anywhere in the documentation where recommendations are made
on things such as as to how to advertise topics? I don't mean the
mechanics of how to code it, that is well documented.

Let me give an example. So I know I want node A to publish topic T
which will be subscribed by node B. Topic T is what I would consider a
'primary' topic in that it's the main output of node A and an
important input for node B, as opposed to some ancillary data or
something for debugging.

Now when advertising T, I can advertise it with the node A's regular
node handle, so it gets advertised as (assuming no runtime namespace
pushdowns) /T, or I can advertise it with the private nodehandle, so
it gets published as /A/T. Which one of these is the 'preferred' way,
and why?

Then, on the other end of that conversation, how do I tell node B what
to subscribe to? Do I explicitly subscribe to either /T or /A/T,
depending on the decision made above, or do I do something like
subscribe to ~input (i.e. /B/input), and require a remapping at
runtime, a la image_view or the pcl filters? Or do I even make the
topic to subscribe to configurable via a parameter?

Very similar questions could be asked of naming for services and parameters..

I like that there is flexibility but it would be nice if there was a
conventional way to do this, as well as some rationale as to why it is
the convention and some guidelines for when to break convention.

Maybe something like this already exists on the wiki and I missed it,
if so just point me there and my apologies. If not this seems like
something that should perhaps go in an Informational REP.

Cheers,
Pat



More information about the ros-users mailing list