[ros-users] problem using TimeSynchronizer with two images

Dan Lazewatsky lazewatskyd at cse.wustl.edu
Thu Mar 11 22:55:04 UTC 2010


Hi all -
I'm trying to use TimeSynchronizer to sync up images from two cameras, 
but I'm having some problems. In the following lines:
     message_filters::Subscriber<Image> left_sub(nh, 
"stereo/left/image", 1);
     message_filters::Subscriber<Image> right_sub(nh, 
"stereo/right/image", 1);

     TimeSynchronizer<Image, Image> sync(left_sub, right_sub, 10);
     sync.registerCallback(boost::bind(&callback, _1, _2));
in the callback, both left and right appear to be the same image (they 
both seem to come from the rightmost subscriber given to sync). I've 
checked stereo/left/image and stereo/right/image with image_view and 
they are definitely different. Is there something I'm missing here? Code 
to reproduce is attached.

On a related note, is there a way to use TimeSynchronizer with 
image_transport rather than subscribing to the image directly?

Thanks,
-Dan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sync_problem.cpp
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100311/e0726d2d/attachment-0003.ksh>


More information about the ros-users mailing list