[ROS] How to fix .bag.active file?

less than 1 minute read

While conducting a robot experiment with ROS (Robot Operating System), you usually use the rosbag package to collect the data from the ROS topics. However, if the ROS master computer is suddenly turned off due to the undesirable situations such as strong collision or static, rosbag node does not create .bag file. Instead, .bag.active file is automatically created, which means that the rosbag process is unexpectedly terminated. Since the .bag.active file cannot be read by the data analysis programs such as MATLAB, it is necessary to recover .bag file.


Recovery process is actually simple. If the created .bag.active file’s name is &&&& and the name of .bag file that you want to create it ####, the entire process is shown as below.

rosbag reindex &&&&.bag.active
rosbag fix &&&&.bag.active ####.bag

Then, .bag file named #### is created in the same folder.





Leave a Comment

Your email address will not be published. Required fields are marked *