ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

what does a topic get when 2 nodes publish to it?

asked 2012-11-28 01:19:10 -0500

Nachum gravatar image

If 2 nodes are publishing to the topic l_leg_uhz_position_controller/command what would the joint do? try doing both?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-11-28 03:55:37 -0500

joq gravatar image

updated 2012-11-29 02:54:11 -0500

In general, messages from multiple publishers get interleaved, with no reasonable way to predict the order in which they will be received. In some cases that can be quite useful, for example when aggregating rosout or diagnostic messages.

As @Ben_S said, the semantics of mixing controller messages depend entirely on that controller's implementation. Most likely it will get confused.

edit flag offensive delete link more

answered 2012-11-28 01:39:31 -0500

Ben_S gravatar image

updated 2012-11-28 02:41:54 -0500

In such a case, most likely the last received command will override any previous ones. If you would like to know the behaviour of a specific controller, i would advise to have a look at the documentation or ultimately at the source code itself if the case isnt mentioned in the docs.

edit flag offensive delete link more


How to correct this? If a topic has 2 publishers but the user needs only a single node to publish? I'm having a similar problem where a certain topic has 2 publishers to it and is malfunctioning

pk99 gravatar image pk99  ( 2021-04-27 09:04:33 -0500 )edit

Question Tools


Asked: 2012-11-28 01:19:10 -0500

Seen: 464 times

Last updated: Nov 29 '12