when I used rosbag open bag file error "An error occurred when reading from the file."

12 views (last 30 days)
When I run my experiment on the desktop computer the bag files can be opened in the MATLAB, but when I transfer the experiment to the laptop and get the bag files the error is reported ( "An error occurred when reading from the file." ) .
There is no Chinese in my file save path, and I tried other solutions to no avail.
clc,clear all
camera='Camera1';
type=0; %depth=0 / rgb=1;
filepath=fullfile('F:\ele_ladder\code\librealsense-master\librealsense-master\wrappers\python\examples',[camera,'.bag']);
bag=rosbag(filepath);
Command Window
An error occurred when reading from the file.
>>
Cannot attach this file because:
  • File:bag file.zip size exceeds 5 MB. Try compressing the image file in an archive format; for example, a zip file.
I dont konw why I can`t updata the bag file.

Answers (1)

fang jie
fang jie on 9 Dec 2021
I solved this problem in Python because of the bag file. Bag file data collection is not standardized.
Reindex bag file in Python with linux.
$ rosbag reindex Camera1.bag
I have not found a good way to solve this problem in MATLAB.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!