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

subscriber and publisher node

asked 2012-07-27 07:03:09 -0600

muin028 gravatar image

updated 2012-07-28 09:53:03 -0600

Eric Perko gravatar image

hello, i am tying to create two nodes-two topics,in which 1.node1 is publishing in topic1 and node2 is subscribing to topic1. 2.node2 is publishing in topic2 and node1 is subscribing to topic2. can anybody give some clue/hints

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-07-27 08:38:00 -0600

joq gravatar image

It looks the same as any simple pub/sub pair, only with both roles included in both nodes. They are basically the same, except for the topic names they subscribe. (With remapping, they could even be identical.)

edit flag offensive delete link more

answered 2012-07-27 07:11:47 -0600

allenh1 gravatar image

You'll need to be a little more specific... there are many tutorials for subscribers and publishers. You are asking for both together.

It is not good practice to publish and subscribe to the same topic inside a node... You have the data available, so just pass the data to whatever processing you would to with a subscriber; however, if you want the data to be read from another node to do processing, you will need to make a second executable. If you need specific instructions, please update your question to be more specific for the setup you desire.

edit flag offensive delete link more



The question is for two nodes that each publish on separate topics, while subscribing to the other's topic. That is useful and legitimate.

joq gravatar image joq  ( 2012-07-27 08:39:41 -0600 )edit

Question Tools


Asked: 2012-07-27 07:03:09 -0600

Seen: 685 times

Last updated: Jul 28 '12