0
$\begingroup$

Rosanswers logo

Hi,

I have tried rosbag2 on latest build Crystel and also play following commands but it gives me some errors. Please guide me for running rosbag2 with the simple example.

  1. ros2 bag record -a
  2. ros2 bag play rosbag2_2019_01_22-17_57_14/rosbag2_2019_01_22-17_57_14.db3
  3. ros2 bag info rosbag2_2019_01_22-17_41_19/rosbag2_2019_01_22-17_41_19.db3

Error:

DISCLAIMER
ros2 bag is currently under development and not ready to use yet
[ERROR] [rosbag2_storage]: Failed to load metadata: Exception on parsing info file: bad file
[ERROR] [rosbag2_storage]: Could not open 'rosbag2_2019_01_22-18_03_08/rosbag2_2019_01_22-18_03_08.db3' with 'sqlite3'. Error: Failed to read from bag 'rosbag2_2019_01_22-18_03_08/rosbag2_2019_01_22-18_03_08.db3': No metadata found.
[ERROR] [rosbag2_storage]: Could not load/open plugin with storage id 'sqlite3'.
[ERROR] [rosbag2_transport]: Failed to play: No storage could be initialized. Abort

Originally posted by Gabbar on ROS Answers with karma: 49 on 2019-01-22

Post score: 2


Original comments

Comment by Technerd on 2019-05-28:
You should run ros2 bag play [folder name] and mention the folder that contains all rosbag files (metdata.yaml,...).

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The idea for rosbag2 is that you don't load the concrete db3 file, but specify the folder where your data is located. Can you try to run

ros2 bag play rosbag2_2019_01_22-17_57_14

I believe this should help.

To give you a bit of background: The file you specified is then getting interpreted as the folder name and within rosbag2 looks for a metdata file telling how to interpret this data. Obviously, this metadata file is not found. I believe though the error messages are misleading. I think it makes sense to check whether the given file is indeed a directory or not and present the error message accordingly. Feel free to open a ticket for this here: https://github.com/ros2/rosbag2


Originally posted by Karsten with karma: 643 on 2019-01-22

This answer was ACCEPTED on the original site

Post score: 6


Original comments

Comment by Gabbar on 2019-01-22:
Thanks !! I forgot to see little comment at the page.

One more question, when we play rosbag with melodic (ROS1). It requires roscore (central management) and In ROS2, We don't need roscore, right? We can use this command directly, Right?

Comment by Karsten on 2019-01-23:
that is correct. You can directly use the rosbag2 command.

Feel free to mark my answer as correct.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.