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

Rosbag cannot record multiple topic with same type

asked 2011-11-23 03:44:47 -0500

ximilian gravatar image

updated 2016-10-24 09:03:25 -0500

ngrennan gravatar image

I am trying to produce a rosbag file for data recorded by a Kinect. I use this launch:

  <node pkg="rosbag" type="record" name="record" output="screen"
  args=" /camera/depth/image_raw /camera/depth/camera_info /camera/rgb/image_raw /camera/rgb/camera_info /camera/driver/parameter_descriptions /camera/driver/parameter_updates -o $(find myproject)/bags/kinect"/>

Looking into the bag file, it seems that only one topic per type can be saved. But, replaying the file, I found that instead both topic (image_raw) are published on the same url. Here is an example:

path:        kinect_2011-11-23-18-13-10.bag
version:     2.0
duration:    5.3s
start:       Nov 23 2011 18:13:11.24 (1322068391.24)
end:         Nov 23 2011 18:13:16.53 (1322068396.53)
size:        43.8 MB
messages:    200
compression: none [50/50 chunks]
types:       dynamic_reconfigure/Config            [be5ce5fa8101a5199199ac5a9b231457]
             dynamic_reconfigure/ConfigDescription [5f0f929417f58ac7f30dfdd9e4d40ef2]
             sensor_msgs/CameraInfo                [c9a58c1b0b154e0e6da7578cb991d214]
             sensor_msgs/Image                     [060021388200f6f0f447d0fcd9c64743]
topics:      /camera/driver/parameter_descriptions    1 msg     : dynamic_reconfigure/ConfigDescription
             /camera/driver/parameter_updates         1 msg     : dynamic_reconfigure/Config           
             /camera/rgb/camera_info                 99 msgs    : sensor_msgs/CameraInfo               
             /camera/rgb/image_raw                   99 msgs    : sensor_msgs/Image

I should have two streams of images on different topic but only one is showed. Is there a limitation on rosbag or am I using it wrongly?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-11-23 19:35:29 -0500

Achim gravatar image

I don't know what the kinnect can do or can not do. But there currently seems to be a bug in rosrecord that scrambles bag files... it's already in the tracker:

I have the very same issue... for a node I have written myself, which definitively publishes two images in two different topics at roughly the same time intervals and which worked some weeks ago not the bag files only have one image topic but the topic seems to contain both images, at least sometimes images from the other topic flicker through, if I just watch the stream with image_view... It's kind of random which image topic will be saved to and which is really the content of the image topic...

A work around is to start a new rosrecord for every image topic you want to record. You can then just give all those bag files to rosrecord play on the command line and it will play them all simultaneously (and then the image topics are working again.. ;))

I hope this bug gets fixed, soon.

edit flag offensive delete link more


Thank you, this helps me a lot on narrowing down the problem. I'll try your solutions and post the results.
ximilian gravatar image ximilian  ( 2011-11-23 22:38:16 -0500 )edit
I have run into this same issue. I noticed that Brian Gerkey checked in a patch for Ticket #3755 and got ros_comm 1.6.6 released about 3 hours ago. In general, when a new release is created how long does it take until it is available from the repos for Ubuntu debs? Also, nice workaround.
Thomas D gravatar image Thomas D  ( 2011-12-08 05:03:24 -0500 )edit
That's definitely a symptom of the problem addressed in #3755. It'll probably be a day or two before new debs are available. A lot of stuff depends on ros_comm, which means that a lot of debs need to be (re)built. The build farm is chugging away now...
Brian Gerkey gravatar image Brian Gerkey  ( 2011-12-08 10:01:50 -0500 )edit

answered 2011-11-23 05:19:19 -0500

tfoote gravatar image

I think you will find that the limitation is in the Kinect driver not the recorder. It will advertise all possible topics, but will only publish on a subset of them depending on the mode you have it set to.

edit flag offensive delete link more


I confirm this is not camera limitation. In my case, my two other image_view node (for monitoring purpose) can subscribe the two image_raw channels and display in realtime without problem while recording the rosbags.
tingfan gravatar image tingfan  ( 2011-11-28 11:42:23 -0500 )edit

Question Tools

1 follower


Asked: 2011-11-23 03:44:47 -0500

Seen: 2,469 times

Last updated: Dec 04 '11