Rosbags containing no messages after reindexing

asked 2022-06-08 03:47:25 -0600

martenf94 gravatar image

Dear all,

I am working on a Ubuntu 20.04 system using ROS Noetic.

I was recording large-size rosbags via the rqt_bag GUI (recording images from multiple indsturial cameras). Each rosbag is between 500 MB and 14 GB. All the rosbags were recorded exactly in the same way using rqt_bag and always the exact same 8 topics were recorded.

Unfortunately, a lot of the recorded rosbags are damaged/broken.

When trying to play the rosbags I receive one of the following five feedbacks:

  1. rosbag runs perfectly without any problem.
  2. rosbag throws error: Unindexed bag. After calling "robag reindex" the bag was successfully migrated and the rosbag plays without problems.
  3. rosbag throws error: Unindexed bag. After calling "robag reindex" the bag was successfully migrated, but when trying to play the migrated bag it plays the rosbag without error, but directly shows "No messages to play on specified topics. Exiting."
  4. rosbag throws error: "Required 'op' field missing"
  5. rosbag throws error: "Expected FILE_HEADER op not found"

I have no idea why there are five different results when recording the rosbag always in the same way.

During my search on the internet, I have once read that it could be based on the problem that the topics /rosout and /rosout_agg were not recorded. But e.g. in a rosbag where no errors appeared there were those two topics also not recorded.

I also already tried to repair the rosbag using the rosbag fix command, but no success, same problems.

Obviously, there is some problem with 'op' but I do not know and do not find what it is. Can we "open" the rosbag in any way to see what is written in the file? Because the file size is very big. There should be some data inside, but obviously they can't be read at the moment.

Any help to save the data would be really appreciated. Thank you very much.

edit retag flag offensive close merge delete

Comments

You can use DB Browser for SQlite to see what is inside the rosbag.

ljaniec gravatar image ljaniec  ( 2022-06-08 04:23:51 -0600 )edit

@ljaniec: the OP is using ROS 1. rosbag in ROS 1 does not use sqlite.

gvdhoorn gravatar image gvdhoorn  ( 2022-06-08 09:16:42 -0600 )edit

@gvdhoorn I stand corrected, thank you - I made a mistake. This related ROS1 question about reading rosbags in code can help @martenf94https://answers.ros.org/question/2883...

ljaniec gravatar image ljaniec  ( 2022-06-08 09:28:59 -0600 )edit

Nothing serious, just wanted to make sure OP doesn't get confused.

gvdhoorn gravatar image gvdhoorn  ( 2022-06-09 01:54:20 -0600 )edit

Thanks for clarifying! But is there any way to take a look at the raw data from ROS1 rosbag?

I already tried to 'open' rosbag with the following option, but does not work. http://wiki.ros.org/rosbag/Code%20API...

martenf94 gravatar image martenf94  ( 2022-06-09 04:30:25 -0600 )edit
1

There are ways to recover data from .bags. A previous Q&A about this would be #q360520.

@iiton stated his/her company has a solution for it, but it wasn't "public" yet.

I've tried to reach out to him/her a few times, but no response.

You could perhaps reach out to the company directly. It's mentioned in the comments under #q360520.

gvdhoorn gravatar image gvdhoorn  ( 2022-06-09 04:34:51 -0600 )edit