Make rosbag record die when roscore dies?

asked 2019-11-19 13:13:27 -0600

lucasw gravatar image

updated 2019-11-19 13:20:54 -0600

It looks like rosbag record is trying hard to be resilient against roscore outages, but I'd like the option of having it die if the roscore goes down, or if another node in the same roslaunch has required="true" and dies for any reason.

Currently I see the rosbag record -a noticing the lack of a master, but sticking around after killing the roscore:

[getPublishedTopics] Failed to contact master at [localhost:11311].  Retrying...

Then if a new roscore is brought up it appears to reconnect:

Connected to master at [localhost:11311]

But doesn't actually fully come back and resubscribe to messages, and rosnode doesn't list it as a node. Perhaps that is a bug to be fixed (though in the case of a roslaunch that contains non-rosbag nodes that don't have extra logic to survive roscore outages, I'd rather relaunch them all than have the rosbags keep going)- maybe there is an easier workaround to just have the record process die?

Maybe the intent is that rosbag can receive a few more messages from other nodes (which may provide clues to why the system is going down if it isn't otherwise clear) instead of turning itself off too early.

In the case where rosbag record is set to record a topic that doesn't exist, it doesn't even notice that the roscore is gone.

edit retag flag offensive close merge delete