[ROS2] ROS1 bag conversion into ros2 bag format using rosbag2 in crystal

asked 2019-02-07 04:39:05 -0500

rohit_agrawal1 gravatar image

Hi Team,

We are using ros2 crystal rosbag2 pkg ( https://github.com/ros2/rosbag2 ) and trying to run info/play/record ROS1 .bag file. Here i am enable to see ros1 .bag meta details into ros2 bag info command as below but unable to play/record for the same.

  • $ source /opt/ros/melodic/setup.bash
  • $ source /opt/ros/crystal/setup.bash
  • $ source ~/rosbag_ws/install/setup.bash

$ ros2 bag info -s rosbag_v2 Mapping_ros1.bag

where Mapping_ros1.bag is the ROS1 .bag file.

The command above will print something like the following:

ros2 bag is currently under development and not ready to use yet

Files:             Mapping_ros1.bag
Bag size:          565.6 KiB
Storage id:        rosbag_v2
Duration:          172.600s
Start:             Jan  1 1970 05:31:00.200 (60.200)
End                Jan  1 1970 05:33:52.800 (232.800)
Messages:          3454
Topic information: Topic: /base_scan | Type: sensor_msgs/LaserScan | Count: 1727 | Serialization Format: rosbag_v2
                   Topic: /base_pose_ground_truth | Type: nav_msgs/Odometry | Count: 1727 | Serialization Format: rosbag_v2

But when we have tried to execute ros2 bag play -s rosbag_v2 Mapping_ros1.bag command to play ros1 .bag file in ros2 crystal, getting the below error.

ros2 bag is currently under development and not ready to use yet
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
Aborted (core dumped)**

Anyone can assist us to crack the above error .

Thank you.

edit retag flag offensive close merge delete


This sounds like a bug to me. Can you try to replay a single topic such as /base_scan? In any case, please open a ticket on github (ideally with a simple reproducible example).

Karsten gravatar image Karsten  ( 2019-04-22 13:36:03 -0500 )edit