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

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

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

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 image NEngelhard  ( 2017-06-14 02:06:36 -0500 )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 image zqpm  ( 2017-06-14 07:45:10 -0500 )edit

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

NEngelhard gravatar image NEngelhard  ( 2017-06-14 08:04:08 -0500 )edit

Consider yourself lucky then.

zqpm gravatar image zqpm  ( 2017-06-14 08:56:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-05 01:51:46 -0500

hank880907 gravatar image

updated 2023-07-05 01:52:35 -0500

The main responsibility of ros core is to maintain a list of connection between nodes. If a node is registered to a dead roscore, new node will not be able to find it. However, the already existing connected topics will stay functional. I personally have created a systemd service for roscore. You can make the systemd service to restart roscore automatically if it dies. Personally I never seen roscore crash. I believe it is not possible for a node to "refresh" with the new roscore.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-06-13 09:48:39 -0500

Seen: 626 times

Last updated: Jul 05 '23