Fatal error R2020b rosbag . when i call bag = rosbag(filename), it shows "An error occurred when reading from the file." However, it works fine in R2020a.

조회 수: 6 (최근 30일)
when i call
bag = rosbag(filename)
it shows "An error occurred when reading from the file."
However, it works fine in R2020a.
this error also affects the normal usage of "SLAM Map Builder" and "Lidar Labeler".
I have test the rosbag file in the help center,
e.g. \Examples\R2020b\ros\RetrieveInformationFromRosbagROSExample\ex_multiple_topics.bag
OK, it works fine.
BUT, why my file raised this error? and it works fine in R2020a.
the test file is attached. Please check it.
  댓글 수: 4
Cris LaPierre
Cris LaPierre 2021년 1월 27일
I have the ability to run the code here using R2020b. See the results below. No error.
Do you have access to MATLAB Online? What happens if you try to run this code there?
unzip('bags.zip')
bag = rosbag("Rosbag Fatal Error.bag")
bag =
BagSelection with properties: FilePath: '/users/mss.system.u02zJA/Rosbag Fatal Error.bag' StartTime: 1.6028e+09 EndTime: 1.6028e+09 NumMessages: 476 AvailableTopics: [2×3 table] AvailableFrames: {0×1 cell} MessageList: [476×4 table]
bag2 = rosbag("2018-06-07-03-58-52.bag")
bag2 =
BagSelection with properties: FilePath: '/users/mss.system.u02zJA/2018-06-07-03-58-52.bag' StartTime: 0 EndTime: 0 NumMessages: 0 AvailableTopics: [0×3 table] AvailableFrames: {} MessageList: [0×4 table]
Tan Shuwen is pig
Tan Shuwen is pig 2021년 3월 21일
I found a solution to the problem, it's very simple, file path of your bag cannot have Chinese character.

댓글을 달려면 로그인하십시오.

답변 (3개)

Tan Shuwen is pig
Tan Shuwen is pig 2021년 1월 28일
I have the same problem after Matlab update.
It works ok in matlab 2020a, but not work in matlab2020b update4.

Tan Shuwen is pig
Tan Shuwen is pig 2021년 3월 21일
I found a solution to the problem, it's very simple, file path of your bag cannot have Chinese character.

fang jie
fang jie 2021년 12월 8일
Hi! I have a question, when I use your bag file there no error, but when I open my bag file with matlab 2019b, the same question come. I don`t know how to solve.
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.

카테고리

Help CenterFile Exchange에서 ROS Log Files and Transformations에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by