Dejan, <div><br></div><div>Your TransformBroadcaster and TransformListener communicate in another thread over the network.  Without any delay it is most likely that the data won't get transfered between sequential calls.  </div>

<div><br></div><div>There are two solutions: </div><div>You can use a waitForTransform or tf::MessageFilter to wait for the data to become available.  </div><div>if you don't care if other instances knowing about this information you can call setTransform on the TransformListener instance.  Which will inject it only for that instance of the tf::TransformeListener.</div>

<div><br></div><div>Tully<br><br><div class="gmail_quote">On Mon, May 3, 2010 at 4:26 PM, Dejan Pangercic <span dir="ltr"><<a href="mailto:dejan.pangercic@gmail.com" target="_blank">dejan.pangercic@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear ROS-itas,<br>
I am giving tf a try to rotate some PointCloud msgs. In my node's<br>
constructor I initialize the transform and broadcast it:<br>
transform1_.setOrigin(tf::Vector3(0.0, 0.0, 0.0));<br>
transform1_.setRotation(tf::Quaternion(tf::Vector3(1, 0, 0),<br>
angles::from_degrees(-30)));<br>
br_.sendTransform(tf::StampedTransform(transform1_, ros::Time::now(),<br>
child_, interim_));<br>
<br>
In the cloudCallback function I then renew the broadcast and use<br>
TransformListener's transformPointCloud for actual rotation:<br>
void cloud_cb (const sensor_msgs::PointCloudConstPtr& pc)<br>
    {<br>
       br_.sendTransform(tf::StampedTransform(transform1_,<br>
ros::Time::now(), child_, interim_));<br>
      try<br>
      {<br>
        tf_listener_.transformPointCloud(origin_, *pc, cloud_in_);<br>
      }<br>
      catch (tf::TransformException ex)<br>
      {<br>
        ROS_ERROR("%s",ex.what());<br>
      }<br>
      cluster_pub_.publish(cloud_in_);<br>
    }<br>
<br>
The transform however fails with the following error msg:<br>
"""<br>
[ERROR] [1272928509.572624390]: You requested a transform at time<br>
1272928509.567,<br>
 but the tf buffer only contains a single transform at time 1272928509.122.<br>
 When trying to transform between /base_link and /RightEyeCalc.<br>
<br>
[ERROR] [1272928514.572514949]: You requested a transform that is<br>
4.317 miliseconds in the past,<br>
but the most recent transform in the tf buffer is 5000.070 miliseconds old.<br>
 When trying to transform between /base_link and /RightEyeCalc.<br>
"""<br>
It seems that tf is not buffering my transforms, so do I have to do<br>
this explicitly?<br>
<br>
thx and cheers, D.<br>
--<br>
MSc. Dejan Pangercic<br>
PhD Student/Researcher<br>
Computer Science IX<br>
Technische Universität München<br>
Telephone: +49 (89) 289-17780<br>
E-Mail: <a href="mailto:dejan.pangercic@in.tum.de" target="_blank">dejan.pangercic@in.tum.de</a><br>
WWW: <a href="http://ias.cs.tum.edu/people/pangercic" target="_blank">http://ias.cs.tum.edu/people/pangercic</a><br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">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>
</blockquote></div><br><br clear="all"><br>-- <br>Tully Foote<br>Systems Engineer<br>Willow Garage, Inc.<br><a href="mailto:tfoote@willowgarage.com" target="_blank">tfoote@willowgarage.com</a><br>(650) 475-2827<br>
</div>