[ INFO] [1641883087.135235462]: Opening basic_localization_stage.bag
[FATAL] [1641883087.219597305]: Error reading from file: wanted 4 bytes, read 0 bytes
回放显示上述报错,可以使用这个命令
rosbag reindex xxx-xxx-xxx.bag
如果显示下面的就是成功了。
basic_localization_stage.bag 100% 1.4 MB 00:00
如果显示这个就是失败了。
Traceback (most recent call last):
File "/opt/ros/melodic/bin/rosbag", line 35, in <module>
rosbag.rosbagmain()
File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/rosbag_main.py", line 1030, in rosbagmain
cmds[cmd](argv[2:])
File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/rosbag_main.py", line 629, in reindex_cmd
bag_op(args, True, True, lambda b: b.version > 102, op, options.output_dir, options.force, options.quiet)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/rosbag_main.py", line 705, in bag_op
shutil.copy(inbag_filename, backup_filename)
File "/usr/lib/python2.7/shutil.py", line 139, in copy
copyfile(src, dst)
File "/usr/lib/python2.7/shutil.py", line 97, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'basic_localization_stage.orig.bag'
是权限问题,
sudo chmod 777 *
在你建立的包下的各个目录下执行一下。就成功了。