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

Restarting Publisher

asked 2011-10-08 06:48:45 -0600

Enrique gravatar image


I just want to share with you some issue I have detected and might be a bug, but probably it's just that I'm missing something. BTW, I'm using diamondback.

I have a couple of nodes: (A) publisher and (B) subscriber. Actually, I'm using image_transport publishers/subscribers. This is how to reproduce the issue given to nodes like above (of course, B subscribes to a topic that A publishes):

run A + run B + stop (Ctrl+C) A + run A

After that, B doesn't receive any msgs from A.

However, if you do:

run B + run A + stop (Ctrl+C) A + run A

it works ---and, of course, you can repeat the last two steps any number of times.

I just wonder why the first "sequence" doesn't work. Is it because it must be done the second way? ---i.e. run subscribers before publishers.



edit retag flag offensive close merge delete


Is `roscore` running continuously throughout these tests?
joq gravatar image joq  ( 2011-10-08 07:07:13 -0600 )edit
I think you've just find the problem, because I'm roslaunching each node (instead of rosrunning). Now I see why I should always do roscore separately; I used to rely on the roscore automatically launched with the first launch file. Thank you!
Enrique gravatar image Enrique  ( 2011-10-08 07:10:25 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-10-08 07:25:04 -0600

joq gravatar image

This is a side-effect of the fact that roslaunch only starts roscore if it was not already running.

In either case, starting roscore first should eliminate the problem:

  • roscore + run A + run B + stop (Ctrl+C) A + run A

  • roscore + run B + run A + stop (Ctrl+C) A + run A

edit flag offensive delete link more

Question Tools


Asked: 2011-10-08 06:48:45 -0600

Seen: 487 times

Last updated: Oct 08 '11