read rosbag file without closing it

asked 2019-10-09 18:01:24 -0500

sai krishna gravatar image

updated 2022-06-11 08:52:20 -0500

lucasw gravatar image


Is there any way in either python or c++ to access rosbag file data without stopping or closing it as opening a bag file while it is recording data throws a ROSBagUndexedException and corrupts the bag file in most of the cases.

edit retag flag offensive close merge delete


Afaik: no, this is not possible.

The (final) index is written upon closure, and reading a bag files requires the indices to be present.

gvdhoorn gravatar image gvdhoorn  ( 2019-10-10 01:14:12 -0500 )edit

rosbag record --split will help you, you won't be able to read the very latest bag but there can be recent ones closed out and indexed trailing behind it

lucasw gravatar image lucasw  ( 2022-06-11 08:56:19 -0500 )edit