发布时间:2024-02-16 15:30
**
一、ERROR bag unindexed: 2021-6-23-0103all.bag. Run rosbag reindex.
**
1. 问题
想要跑一个很久没有用的.bag文件,运行命令:rosbag info xxx.bag
,发现报错了,如下所示:
ERROR bag unindexed: 2021-6-23-0103all.bag. Run rosbag reindex.
想强行播放一下:rosbag play xxx.bag
,也不行,报错如下:
[ INFO] [1624972506.447439941]: Opening 2021-6-23-0103all.bag
[FATAL] [1624972506.448068825]: Error reading from file: wanted 4 bytes, read 0 bytes
2. 解决
根据报错提示,输入命令:
rosbag reindex xxx.bag
会产生两个.bag文件,如下所示:
图片中xx.orig.bag
是最开始的那个包,xxx.bag
是reindex后的包.需要注意:xxx.bag
比原来的包xx.orig.bag要小
最后输入命令:rosbag info xxx.bag
就可以正常输出了,如下:
**
二、Received an invalid TCPROS header. Each element must be prepended
by a 4-byte length. at line 88 in
/tmp/binarydeb/ros-kinetic-cpp-common-0.6.11/src/header.cpp
**
可能是使用外接移动硬盘存储bag包的问题,经常插拔移动硬盘对其中的bag包造成了损坏,再次播放时出现如下错误:
[ INFO] [1626141835.608561277]: Opening outside.bag库
Error: Received an invalid TCPROS header. Each element must be prepended by a 4-byte length.
at line 88 in /tmp/binarydeb/ros-kinetic-cpp-common-0.6.11/src/header.cpp
转而去看看rosbag info xxx.bag
可不可行,报出了“一”中的错误,如下: 参考“一”中方案得到解决
@meng