[ros-users] rxbag Exception when viewing bag files with sensor_msgs/Image topics

Jolin Jia pplin86 at gmail.com
Fri Nov 5 14:38:27 UTC 2010


When I run our camera data, and record the /cameraBumblebee2/left/Image_raw
topic in the bag file. When I run the rxbag to see the image, I received
this exception:
$rxbag _2010-11-05-21-59-40.bag
Error loading image on topic /cameraBumblebee2/left/image_raw: buffer is not
long enough
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
  File "/opt/ros/cturtle/ros/tools/rxbag/src/rxbag/timeline_cache.py", line
95, in run
    msg_stamp, item = self.loader(topic, stamp, item_details)
line 177, in _load_thumbnail
    thumbnail_bitmap = image_helper.pil_to_cairo(thumbnail)
line 117, in pil_to_cairo
    return cairo.ImageSurface.create_for_data(data, cairo.FORMAT_ARGB32, w,
TypeError: buffer is not long enough
My system:
Guest Ubuntu Lucid Lynx 10.04 and CTurtle binary install 1.2.x.

Steps to reproduce:
1. rosrun our camera package
2. rosbag record /cameraBumblebee2/left/Image_raw
3. rxbag *.bag
4. View the "Image" of an Image topic
5. The images will not appear and the exception will be in the terminal
where rxbag was launched from.

And the image type is as following:
height: 240
width: 320
encoding: rgb8
is_bigendian: 0
step: 960

PS: When I use the another type of the image as follwing:
height: 480
width: 640
encoding: bayer_bggr8
is_bigendian: 0
step: 640
This kind of image can show in the rxbag tool.

Why this happened? What's matter with it? And I found that somebody had this
problem, an advised way is that "rgb8 format isn't being converted to RGBA
format (needed by Cairo) when rgba argument is True. Removing lines 58-59
enables the image to display, but red and blue channels in example bag
appear swapped." But this way is useless to me! Any help will be
appreciated! Thanks in advanced!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20101105/82d7fad9/attachment-0002.html>

More information about the ros-users mailing list