[ros-users] re-subscription

Brian Gerkey gerkey at willowgarage.com
Thu Mar 4 15:51:11 UTC 2010


On Thu, Mar 4, 2010 at 3:51 AM, Klaus Petersen
<klaus at takanishi.mech.waseda.ac.jp> wrote:
> I have a very basic problem: First, I establish a connection between a
> publisher node and a subscriber node. At this point I can receive
> messages from the publisher with the subscriber node. But when I
> re-start my publisher node (quit and run again) the subscriber does not
> automatically resubscribe to the message. I have to restart the
> subscriber as well to be able to receive again. Is this the normal
> behavior with ros or am I doing something wrong? I have quite a big
> robot control program tied to one of the nodes, so restarting along the
> way (the initialization of the robot takes ages) is very troublesome.

hi Klaus,

Something's going wrong there.  When your publisher is restarted, it
should re-advertise with the master, which should send the new
publisher list to your subscriber, which should then re-connect to
your publisher.

You can test this behavior with roscpp_tutorials/talker and
roscpp_tutorials/listener; no matter in what order they're
(re)started, listener will always connect to talker.

Can you tell us something about your publisher and subscriber? Is
there anything unusual about your subscriber?

	brian.



More information about the ros-users mailing list