Ask Your Question

Bag created with rosbag api is not publishing

asked 2019-02-04 10:17:54 -0500

ehumenay gravatar image

updated 2019-02-05 09:06:54 -0500

gvdhoorn gravatar image

I am new to ROS. I am attempting to take pointcloud data that is in a format not compatible with ROS and convert it to a ROS bag using the C++ rosbag API. I am having an issue with the newly created bag not publishing data to the topic. For example, whenever I use the command "rostopic echo my_topic" while playing the bag with "rosbag play newConverted.bag" there is nothing printed to the console.

If I open the newConverted.bag with rqt_bag, right click on a topic and select publish, the data is then published to the topic and I can see it in rviz and with the rosbag echo command as expected.

I must be missing something in my bag conversion code that tells ROS to automatically publish the topic when playing. Thoughts?


$ rosbag info newConverted.bag 
path:        newConverted.bag 
version:     2.0
duration:    15:00s (900s)
start:       Jan 08 2019 11:11:02.93 (1546963862.93)
end:         Jan 08 2019 11:26:03.04 (1546964763.04)
size:        423.1 MB
messages:    67496
compression: none [557/557 chunks]
types:       sensor_msgs/Imu           [6a62c6daae103f4ff57a132d6f95cec2]
             sensor_msgs/MagneticField [2f3b0b43eed0c9501de0fa3ff89a45aa]
             sensor_msgs/PointCloud2   [1158d486dd51d683ce2f1be655c3c181]
topics:      cloud_1        11250 msgs    : sensor_msgs/PointCloud2
             cloud_2        11248 msgs    : sensor_msgs/PointCloud2  
             imu/data_raw   22499 msgs    : sensor_msgs/Imu          
             imu/mag        22499 msgs    : sensor_msgs/MagneticField
edit retag flag offensive close merge delete


Can you post what shows up in the terminal if you type rosbag info newConverted.bag?

robustify gravatar image robustify  ( 2019-02-04 19:18:27 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-05 13:54:18 -0500

ehumenay gravatar image

I solved the problem. I was making a mistake and incorrectly processing the timestamp of the last message in the file whenever building the bag

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-02-04 10:17:54 -0500

Seen: 156 times

Last updated: Feb 05 '19