Possible for a node to "refresh" information with rosmaster?

asked 2017-06-13 09:48:39 -0600

zqpm gravatar image

The basic scenario I would like to avoid

  1. Start roscore
  2. Start node A subscribing to topic B
  3. Kill roscore and restart roscore
  4. Start node B publishing topic B Result: Node A has not registered its subscription to topic B with the new roscore instance, and so no connection will be made with node B and node A will not get messages on topic B

Running into this problem when I have diagnostic nodes (e.g., rqt_plot) which I have to restart everytime I kill a roslaunch file. The not-so-great solution is to just spawn roscore in the background and hope that it never dies for any reason.

Is there a way to get a node to periodically refresh it's connection with rosmaster so that it rosmaster restarted it would (eventually) get the pub/sub information from that node and could make the proper connections?

edit retag flag offensive close merge delete

Comments

Why do you want to kill the roscore? I normally run it in a tmux-session so that is also does not need it's own terminal window.

NEngelhard gravatar imageNEngelhard ( 2017-06-14 02:06:36 -0600 )edit

I don't, but shit happens. To quote: The not-so-great solution is to just spawn roscore in the background and hope that it never dies for any reason

zqpm gravatar imagezqpm ( 2017-06-14 07:45:10 -0600 )edit

I've never seen the roscore crash. That's why I wonder why you want to protect yourself against it.

NEngelhard gravatar imageNEngelhard ( 2017-06-14 08:04:08 -0600 )edit

Consider yourself lucky then.

zqpm gravatar imagezqpm ( 2017-06-14 08:56:16 -0600 )edit