ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

What are the steps to record and play with rosbag2?

asked 2019-01-22 06:42:47 -0600

Gabbar gravatar image

updated 2019-01-22 06:44:19 -0600


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


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
edit retag flag offensive close merge delete


You should run ros2 bag play [folder name] and mention the folder that contains all rosbag files (metdata.yaml,...).

Technerd gravatar image Technerd  ( 2019-05-28 05:42:35 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-01-22 16:21:12 -0600

Karsten gravatar image

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:

edit flag offensive delete link more


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?

Gabbar gravatar image Gabbar  ( 2019-01-22 22:17:51 -0600 )edit

that is correct. You can directly use the rosbag2 command.

Feel free to mark my answer as correct.

Karsten gravatar image Karsten  ( 2019-01-23 10:24:41 -0600 )edit

Question Tools



Asked: 2019-01-22 06:42:47 -0600

Seen: 6,889 times

Last updated: Jan 22 '19