0
$\begingroup$

Rosanswers logo

Hello,

I would like to convert a ROS2 bag file (.db3) to ROS1 bag file (.bag). This question has been asked before but we no answer so I decided to repeat it by adding another question as well.

also, is it possible to read the ROS2 bag file within ROS1? I have found a plugin which does the inverse but I did not find anything related to what I need.

Any idea? Thanks,


Originally posted by Mobile_robot on ROS Answers with karma: 264 on 2021-10-12

Post score: 0


Original comments

Comment by gvdhoorn on 2021-10-12:
You already found #q352466 yourself. Please don't post duplicates.

Comment by Mobile_robot on 2021-10-12:
I am sorry, but as an admin you should be more careful. This is NOT the same question. Please read carefully the Titles. This is the question on how READING the robag2 file within ROS1. But inside of this question, the previous question on how to CONVERT the ROS2 bag file to ROS1 bag file has been mentioned!

Comment by gvdhoorn on 2021-10-12:
I'm not sure I understand your comment (and the caps are not needed).

I'm also not sure whether the distinction between reading and converting is sufficient to warrant a new question.

Part of conversion is reading.

If you really want a separate answer, I'll re-open and post it.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

is it possible to read the ROS2 bag file within ROS1?

no, this is not supported right now. rosbag in ROS 1 does not have the same "pluggable storage backend" concept as rosbag in ROS 2 has. That plugin system is what makes the plugin you found work.

Unless someone extends rosbag with this capability of course.

To do that, you could use the Python library mentioned in #q352466 (although the core of rosbag is actually C++), but I doubt it would be trivial to make such a process robust, as the mapping between ROS1<->ROS2 topics is not always obvious (or even feasible).

Extending rosbag is possible though. See ros/ros_comm#1206 and ros/ros_comm#1499 which added bag encryption to rosbag.


Originally posted by gvdhoorn with karma: 86574 on 2021-10-12

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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