rosbag2 icon indicating copy to clipboard operation
rosbag2 copied to clipboard

Ros bag reindex does not work when bag is compressed

Open vinnnyr opened this issue 2 years ago • 0 comments

Description

Right now ros2 bag reindex does not seem to work when the bag contains compressed files with splits

Expected Behavior

Ros2 bag reindex works even when a bag contains compressed data

Actual Behavior

ros2 bag reindex rosbag2_2022_04_14-13_51_57/ sqlite3
[INFO] [1649944436.363279057] [rosbag2_cpp]: Beginning reindexing bag in directory: rosbag2_2022_04_14-13_51_57/
No database files found for reindexing. Abort

To Reproduce

** Steps to reproduce the behavior, e.g.

  1. Record a bag with splits and compression: ros2 topic pub /chatter std_msgs/msg/Int32 '{data: 1}' -r 2 & ros2 bag record -a -d 1 --compression-mode file --compression-format zstd
  2. Either copy the folder being created in step 1, OR send sigint via Ctrl C and rm -rf metadata.yaml so that we create scenario that reindex is needed. By this step your bag directory should look like this: rosbag2_2022_04_14-13_51_57_0.db3.zstd rosbag2_2022_04_14-13_51_57_2.db3.zstd rosbag2_2022_04_14-13_51_57_4.db3.zstd rosbag2_2022_04_14-13_51_57_6.db3.zstd rosbag2_2022_04_14-13_51_57_8.db3.zstd rosbag2_2022_04_14-13_51_57_1.db3.zstd rosbag2_2022_04_14-13_51_57_3.db3.zstd rosbag2_2022_04_14-13_51_57_5.db3.zstd rosbag2_2022_04_14-13_51_57_7.db3.zstd
  3. Attempt to reindex this bag : ros2 bag reindex my_bag_name/ sqlite3

System (please complete the following information)

  • OS: Ubuntu Focal
  • ROS 2 Distro: galactic
  • Version: apt binaries for 0.9.1

Additional context

This is important for a context I am trying to use rosbag for when it is impossible for me to send SIGINT to the recorder to generate a metadata.yaml . Without a valid metadata.yaml, the compressed rosbag2 is unusable, where as the uncompressed one it not.

In order to overcome this bug for my application in the short term, I just plan on using uncompressed bags, but compressed bags would be helpful.

vinnnyr avatar Apr 14 '22 14:04 vinnnyr