TimeSynchronizer is doing fine, the problem is caused by CvBridge.<br><br>A CvBridge object is designed to handle one image at a time.  So for this case you should create two CvBridge objects, one for left and one for right.<br>
<br>So the code should be:<br><br><div style="margin-left: 40px; font-family: courier new,monospace;"><b>sensor_msgs::CvBridge bridge[2];<br><br>void callback(const ImageConstPtr& left, const ImageConstPtr& right) {<br>
        IplImage* im_left       = bridge[0].imgMsgToCv(left,  "rgb8");<br>      IplImage* im_right      = bridge[1].imgMsgToCv(right, "rgb8");<br><br>            cvShowImage("left", im_left);<br>       cvShowImage("right", im_right);<br>
}<br></b>   </div><pre><br></pre><br><br><div class="gmail_quote">On Thu, Mar 11, 2010 at 2:55 PM, Dan Lazewatsky <span dir="ltr"><<a href="mailto:lazewatskyd@cse.wustl.edu">lazewatskyd@cse.wustl.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all -<br>
I'm trying to use TimeSynchronizer to sync up images from two cameras, but I'm having some problems. In the following lines:<br>
    message_filters::Subscriber<Image> left_sub(nh, "stereo/left/image", 1);<br>
    message_filters::Subscriber<Image> right_sub(nh, "stereo/right/image", 1);<br>
<br>
    TimeSynchronizer<Image, Image> sync(left_sub, right_sub, 10);<br>
    sync.registerCallback(boost::bind(&callback, _1, _2));<br>
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.<br>

<br>
On a related note, is there a way to use TimeSynchronizer with image_transport rather than subscribing to the image directly?<br>
<br>
Thanks,<br><font color="#888888">
-Dan<br>
</font><br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>J.<br><br>