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

conversion of rosbag file format to rosbag2 file format.

asked 2019-01-31 06:52:13 -0500

kishornaik10 gravatar image

I have multiple rosbag (.bag) files stored, I want to use those files in ROS2 (.db3).
Is any tool available to convert the files directly compatible to ROS2?

Currently, I am using ros1bridge, but it will be good if tool is there to help.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2019-02-01 13:51:14 -0500

Karsten gravatar image

updated 2020-01-05 10:55:33 -0500

lucasw gravatar image

there is currently no explicit command line tool which converts from ros1 to ros2. however, the current rosbag2 cli allows to replay ros1 bag files and can thus be used to record a new ros2 bag file based on the replay of ros1.

you can find a bit of documentation here on how to replay ros1 bag files:

In order to use the plugins, again, the ROS 1 installation must be sourced before sourcing the ROS 2 installation. You can then just use the plugin through the regular interface. ...

For playing, one can similarly write:

ros2 bag play -s rosbag_v2 <path_to_bagfile>

If there is ROS 1 data where no topic matching exists to ROS 2 these topics are ignored when replying. When calling ros2 bag info, one can see a list of mismatching topics: ...

that being said, the api is functional enough to replay ros1 bag files and i believe it shouldn't be too hard to develop a real conversion tool for it based on that API.

edit flag offensive delete link more


Updated the link and added some text from it so it can be tracked done more easily if it moves again. 'there is currently no explicit command line tool which converts from ros1 to ros2.' is still true now?

lucasw gravatar image lucasw  ( 2020-01-05 10:56:05 -0500 )edit

Looks like this is still pending with an issue at

marguedas gravatar image marguedas  ( 2020-02-04 03:35:50 -0500 )edit

answered 2021-07-01 01:09:43 -0500

hosh gravatar image

You can use rosbags

edit flag offensive delete link more

answered 2021-04-21 06:14:05 -0500

xmfcx gravatar image

Here I've made a tool for this, you can use it to do the conversion.

For summary there are 2 workspaces.

WS1 converts rosbag file to .proto_rosbag2 format.

WS2 converts .proto_rosbag2 file to rosbag2 format.

This is the repo link:

edit flag offensive delete link more

Question Tools



Asked: 2019-01-31 06:52:13 -0500

Seen: 4,244 times

Last updated: Jul 01 '21