rosbag c++ API for stop recording

asked 2020-02-25 22:57:27 -0500

taehan gravatar image

hi, I'm trying to make data record node by using rosbag record c++ api. But I cannot find the stop recording function at the rosbag::Recorder class. As I know, rosbag::Recorder class support only doTrigger(), run(), subscribe() functions.

Could you share me some idea to stop recording without shutdown the node?

Thanks in advance.

edit retag flag offensive close merge delete


Hi @taehan,

Maybe you can use the functions startWriting, stopWriting. Listen to an input to "activate" or "deactivate" the read/write tasks.

Weasfas gravatar image Weasfas  ( 2020-02-26 07:37:01 -0500 )edit

Thanks for your information. Actually, as you know, startWriting, stopWriting functions are private, so I cannot access them. I think ROS record c++ API does not have stop function yet.

Currently, I solved the problem above to make another recordWrapper node, and recordWrapper node control start/stop recording tasks. I think it is not a nice solution, but it is working now. If you have another idea, please let us know.

taehan gravatar image taehan  ( 2020-02-26 19:04:46 -0500 )edit


And why not closing the bag every time you want to stop and open it whenever you want to write?

I think I am missing a point here because I do not really know why you want to stop recording without shutting down the rosbag.

is this and xy problem, what do you want to achieve with that behavior?

Weasfas gravatar image Weasfas  ( 2020-02-27 02:29:10 -0500 )edit