How to detect broken rosbag files
Hello ROS users,
I've recorded plenty rosbag files during a testrun with a 1min split and lz4 compression. Afterwards some of the data got corrupted (by the harddrive, not an error with rosbag). When playing the rosbag files, it works and starts normally, but if rosbag hits a broken file, I get the following msg:
ROSLZ4_DATA_ERROR: malformed data to decompress
I now want to identify the broken rosbag-files and either try to fix them or if they are not fixable, delete them. But I don't find a way to identify these broken files, does anybody know a way?
My first thought was to use "rosbag check", but this seems not to be intended for this use, or is it and I am not able to see this?
Does anybody had a similar problem and does know a solution in the ROS eco-system?
kindly regards
Tobias
So you tried all commandline options http://wiki.ros.org/rosbag/Commandline ?
I did not try all options, but I read about all of them, and "rosbag check" was the only one that seemed it might be suitable, but it was not, therefore my question, did I miss something or is there no such command and I have to write a script to play them all and wait for this error?
If I were in your shoe I'd try all commands. Since you say in the title that you want to detect files with issues, I thought if a command that indicates "something is wrong with this file". E.g. if
rosbag info
returns something wrong or doesn't terminate correctly, then that could meet your needs.The files only create problems when they are played and even then only when there are subscriber on the topics :( I wrote a script to play them one after another and display the faulty bag files.
The script: