Convert ROS1 bag to ROS2 bag
For rosbag files recorded in ROS1 environment, we cannot use them directly in ROS2 environment. There are some discussions on workarounds. In summary, there are two ways, as summarized in this article.
Solution 1: Install rosbag_v2
plugin and ros1_bridge
rosbag_v2
plugin and ros1_bridge
Requirement: Ubuntu 20 or below, where we have both ROS1 and ROS2 available.
Follow the instructions in ros1_bridge and rosbag_v2 to install.
We can then playback ros1 bag files in a ros2 environment.
Additional comments: For Ubuntu 22 or above environment, according to ros2 official docs, it may be possible to install ros1_bridge alongside ros2, if ros2 is installed from source. In practice, I did not run through this successfully and got stuck at the ros-core-dev : Depends: catkin but it is not installable
error.
References:
Solution 2: Use rosbags
to convert bag files (Recommended)
rosbags
to convert bag files (Recommended)This is a python package that does not depend on ros environment. We can convert a ros1 bag file into ros2 bag by running the following commands.
References:
Last updated