What are rosbag --split and --chunksize useful for?

asked 2020-10-20 10:06:46 -0500

jorgemia gravatar image

updated 2020-10-20 11:29:50 -0500

I've been reading quite a lot about rosbags and the command line options. I'm looking to record rgb and depth data from a ZED camera which takes up quite a lot of space very quickly.

It seems the --split option is useful to break up the recorded data into more manageable sized files. Other than for easier post-processing of these files/having multiple files instead of a huge one what benefits does this option offer?

Does it affect writing speed at all? Or make it easier/faster to play back files? (I guess if you have multiple files you could play a specific part easily instead of playing a huge file and waiting for that specific part to be published?)

In a similar way, what exactly does the --chunksize option do when compared to the --split?

Record to chunks of SIZE KB (Default: 768). This is a buffer within the bag file object. Lowering this value will result in more writes to disk.

Is a chunk just a certain amount of bag data? Does that mean that the data won't be written to the disk until the chunksize is reached? If you increase the value a lot can data be lost somehow (eg. it's not written to the disk)? Or, on the other hand, if you lower it too much the disk might not be able to write the data fast enough?

Does it affect playback at all (It seems that a lot of chunks makes playback slower https://github.com/ros/ros_comm/issue...) ?

Additional Edit: If I understand correctly data flows in this way:

Published topic -> buffer (configured using --buffsize) -> bag object -> buffer (configured using --chunksize) -> SSD/Hard Drive ?

edit retag flag offensive close merge delete