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

Playback ROS1 bag files in ROS2

asked 2022-06-13 21:23:53 -0500

jclinton830 gravatar image

What is the method to playback rosbag files recorded from ROS melodic in ROS2 Humble running on Ubuntu 22.04?

I know the existence of ros1_bridge, but it seems for this to work I must install ROS1 and ROS2 side by side in the same computer. With ROS2 Humble only being available for Ubuntu 22.04 and ROS1 Melodic not being supported in Ubuntu 22.04 make the usage of ros1_bridge impossible, right? Or am I missing something?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-06-13 21:59:50 -0500

jclinton830 gravatar image

So I was right in my assumption but I found some information about this problem and a fix by following the how to guide on ROS2 humble documentation website. This shows how to use ros1_bridge with ROS2 Humble in Ubuntu 22.04. Below is the link to the solution. I hope a neater approach will be made possible soon.

https://docs.ros.org/en/humble/How-To...

edit flag offensive delete link more

Comments

1

I know this problem has been solved but I think this rosbag would be of use to you in the future! It's a pure python library that provides read-write access to both ros1 bags and ros2 bags during their conversion!

qilin_gundamenjoyer gravatar image qilin_gundamenjoyer  ( 2022-06-16 00:45:59 -0500 )edit

Yes that is exactly what I need. Thanks.

jclinton830 gravatar image jclinton830  ( 2022-06-16 22:37:57 -0500 )edit

I did try to install ros1_bridge and ros2 humble following the docmentation you posted. However after building ros2 from source and removing packages.ros.org from the sources.list, the error that should be fixed by removing the file from the source.list still keeps occuring: "The following packages have unmet dependecies: ros-core-dev: Depends: catkin but it is not installabe E: Unable to correct problems, you have held broken packages." How did you solve this?

SimJon1 gravatar image SimJon1  ( 2023-05-09 05:21:29 -0500 )edit
0

answered 2022-06-13 21:37:52 -0500

qilin_gundamenjoyer gravatar image

Install rosbag2 instead of rosbag for Humble since it is supported for ROS2. The installation guide is provided on the GitHub link here or below. After installation, type ros2 bag play <bag_file> in the terminal. Before installing bridges from ROS1 to ROS2, always check the ROS Index for the package you want to install for your distro.

rosbag2 repo: https://github.com/ros2/rosbag2

edit flag offensive delete link more

Comments

Not exactly what I was looking for. I posted the answer above.

jclinton830 gravatar image jclinton830  ( 2022-06-13 22:00:40 -0500 )edit

My bad. Glad you found the workaround.

qilin_gundamenjoyer gravatar image qilin_gundamenjoyer  ( 2022-06-14 12:25:21 -0500 )edit

Yeah I could have done what you suggested if the bag formats were the same, but they are not

jclinton830 gravatar image jclinton830  ( 2022-06-14 22:20:37 -0500 )edit

Interesting that these two formats aren't the same. Knowing ROS, I intuitively thought that the format would have stayed the same for both ROS versions but I guess I'm missing something. Did you end up finding why the formats were different?

qilin_gundamenjoyer gravatar image qilin_gundamenjoyer  ( 2022-06-14 22:37:22 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-06-13 21:23:53 -0500

Seen: 2,032 times

Last updated: Jun 13 '22