Ask Your Question
0

Publishers and Subscribers in one node or two?

asked 2020-03-01 07:03:41 -0500

mandymandymandy gravatar image

Hey there, I was wondering for a fairly number of publishers and subscribers (~50 each), would it be better to put the publishers in one node and the subscribers in another, or is it okay to add all of them in one node?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-02 02:10:01 -0500

Weasfas gravatar image

updated 2020-03-02 11:44:18 -0500

Hi @mandymandymandy,

At the end of the day the only thing you will have will be a set of thread executing publishing tasks or subscribing ones so technically it does not matter. On the other hand, there are important things like keeping the code clean, adjust to ROS standards and organizing properly your project.

If you are OK dealing with the set of subscribers and publishers in the same node go ahead, but take into account that if you split this two sets in two different nodes, technically you will have the same set up but better understanding of your package structure and code.

At least is how I see it, if someone in this community wants to add more background on this kind of problems I will be glad to hear it.

edit flag offensive delete link more

Comments

When a publisher and subscriber use the same topic both exist inside the same node

This statement is incorrect. Topics and nodes are two completely separate concepts. Publishers and subscribers of the same topic can existing in the same node as well as in separate nodes.

Dirk Thomas gravatar image Dirk Thomas  ( 2020-03-02 11:15:30 -0500 )edit

Well,

That sentenced was extracted direcly from the ROS wiki. But I realise now I misread that line. Thanks for noticing I will update the comment.

Weasfas gravatar image Weasfas  ( 2020-03-02 11:44:06 -0500 )edit

Also take into consideration that more nodes -> bigger system. Going from one node to two nodes does not matter much. Going from one node to 10 or 100 nodes will have significant impact. This impact will be bigger in older versions of ROS2 because of this issue https://discourse.ros.org/t/reconside... . Future releases will probably deal with this better.

I mention this to clarify that although you won't see a difference at network level (same amount of publishers, subscribers, same rates, same data) the underlying DDS setup and system will be very different and this will have a performance impact.

MCornelis gravatar image MCornelis  ( 2020-03-04 04:19:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-03-01 07:03:41 -0500

Seen: 188 times

Last updated: Mar 02 '20