ros2bagreader unable to parse "metadata.yaml"

Hello, I am trying to open a mcap ros2 bag and I receive the following error:
Error using ros2bagreader (line 478)
Unable to parse "metadata.yaml" file in the specified folder path. Ensure that the YAML file is correctly formatted.
I am using matlab 2024b version.
Any advice on how to solve this issue?
Thank you,
Annalisa

4 件のコメント

Simone
Simone 2025 年 2 月 26 日
編集済み: Simone 2025 年 2 月 26 日
I have the same problem, probably the YAML file version in the rosbags is too recent for the ros2bagreader function. I tried with an old bag, and it works.
Seigan
Seigan 2025 年 3 月 5 日
I have the same issue. ros2bagreader can't read my .mcap file because there seems to be a problem inside the metadata.yaml file.
@Simone : could you please share your working metadata.yaml file? In order for us to compare the format/structure of this file.
SACHIN KHANDELWAL
SACHIN KHANDELWAL 2025 年 4 月 21 日
Hi @Annalisa, @Simone, could you please share files to reproduce the issue ?
Simone
Simone 2025 年 5 月 1 日
編集済み: Simone 2025 年 5 月 1 日
I can't share the entire metadata.yaml file, but I believe the issue can be identified by looking at just these few lines:
rosbag2_bagfile_information:
version: 9
storage_identifier: mcap
duration:
nanoseconds: 156929000527
starting_time:
nanoseconds_since_epoch: 1741604982945181385
message_count: 646482
topics_with_message_count:
- topic_metadata:
name: /mapping/global_slope
type: nav_msgs/msg/OccupancyGrid
serialization_format: cdr
offered_qos_profiles:
- history: unknown
depth: 0
reliability: reliable
durability: volatile
deadline:
sec: 9223372036
nsec: 854775807
lifespan:
sec: 9223372036
nsec: 854775807
liveliness: automatic
liveliness_lease_duration:
sec: 9223372036
nsec: 854775807
avoid_ros_namespace_conventions: false
type_description_hash: ..
message_count: 782
The 'offered_qos_profiles' entry was previously provided as a list, but now (version 9) each sub-entry appears on a new line, and the ros2bagreader function does not work

サインインしてコメントする。

回答 (1 件)

Gayathri
Gayathri 2025 年 5 月 5 日
編集済み: Gayathri 2025 年 5 月 5 日

0 投票

The error you are experiencing may be due to MATLAB R2024b only supporting bag files created with the ROS 2 distribution "Humble Hawksbill." If your bag file was created using a different ROS 2 distribution, this could be causing the issue.
Starting with the MATLAB R2025a Prerelease, the function is compatible with the ROS 2 distribution "Jazzy Jalisco" and should work without any errors.

1 件のコメント

Simone
Simone 2025 年 5 月 8 日
Alright, thank you for your support

サインインしてコメントする。

カテゴリ

質問済み:

2025 年 2 月 20 日

コメント済み:

2025 年 5 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by