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

조회 수: 21 (최근 30일)
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.

답변 (1개)

fang jie
fang jie 2021년 12월 9일
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.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by