Ask Your Question
0

Do a publisher and a subscriber on the same machine incur network load?

asked 2020-03-10 12:20:55 -0500

JunTuck gravatar image

Hello all :) I have a few questions regarding ROS network communication.

  1. I have a Publisher and a Subscriber living on Machine A, with Machine B as the ROS Master. Do they still send messages over the network? If they do not, do the messages still get serialized and deserialized? (I wonder what really happens behind scenes)

  2. Same as (1.), but now both Publisher and Subscriber live in the same node. Does it make any difference?

  3. I'm aware of the concept of nodelets for accessing shared memory. Does the Publisher/Subscriber paradigm have any similar functionality?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-03-10 15:56:23 -0500

gvdhoorn gravatar image

updated 2020-03-10 15:57:45 -0500

I have a Publisher and a Subscriber living on Machine A, with Machine B as the ROS Master. Do they still send messages over the network?

See #q276636 (also related: #q285336).

If they do not, do the messages still get serialized and deserialized? [..] Now both Publisher and Subscriber live in the same node. Does it make any difference?

(de)serialisation always happens, no matter where publishers or subscribers "live", unless you're using nodelets.

I'm aware of the concept of nodelets for accessing shared memory. Does the Publisher/Subscriber paradigm have any similar functionality?

This question is a bit strange: both nodes and nodelets contain publishers and subscribers. Zero-copy message exchange is not a property of subscribers or publishers, but of nodelets.

So: if the publisher and the subscriber exist in nodelets and share the same memory address space (ie: are loaded in the same nodelet manager), then zero-copy message exchange can be used.

Otherwise it's not possible.

There have been some shared-memory transports in the past, but they're unmaintained, and (almost certainly) incompatible with current ROS versions.

edit flag offensive delete link more

Comments

1

PS: please refrain from posting multiple questions in a single question. The "other questions" have very poor visibility, as the title of your post does not cover them. ROS Answers is not a forum, but an AskBot instance, which works best with a 1-to-1 ratio of questions-to-answers.

In the future, post multiple questions (after making sure they do not already exist).

gvdhoorn gravatar image gvdhoorn  ( 2020-03-10 15:56:31 -0500 )edit

Thanks @gvdhoorn for the clear and concise response, as well as for the heads up about multiple questions. Noted for the future!

JunTuck gravatar image JunTuck  ( 2020-03-26 08:15:59 -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

Stats

Asked: 2020-03-10 12:20:55 -0500

Seen: 26 times

Last updated: Mar 10