1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【ROS2】壊れたbagを修復する

Last updated at Posted at 2024-11-09

metadata.yamlが壊れていて

$ ros2 bag info /path/to/bag
Exception on parsing info file: yaml-cpp: error at line 1, column 3: unknown escape character:

reindexにも失敗する

$ ros2 bag reindex /path/to/bag
[INFO] [1731135419.165427003] [rosbag2_cpp]: Beginning reindexing bag in directory: /path/to/bag

closing.

closing.
[INFO] [1731135419.182126217] [rosbag2_storage]: Opened database '/path/to/bag/file.db3' for READ_ONLY.
[1]    27536 segmentation fault (core dumped)  ros2 bag reindex /path/to/bag

そんなときは

$ mv /path/to/bag/file.db3 /path/to/bag/file.db3.bak
$ sqlite3 /path/to/bag/file.db3.bak ".recover" | sqlite3 /path/to/bag/file.db3
$ ros2 bag reindex /path/to/bag

こう!

上の手順も通用しない場合は以下のコメントを参考にsqlite3のコマンドを叩くとなんとかなるかもしれません(sqlわかりません)

そもそも普通にCtrl-Cでrecord止めてるのに壊れるのなんなんだ?

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?