Hi Nicolas, <br><br>If you print out the exception string we can help you more.  I suspect that it might show you that your query is too early instead of too late.  <br><br>If you are not particular about exactly when the transform is looked up I would suggest that you use ros::Time(0), this is a special value which will lookup to the latest available time.  Instead of ros::Time::now() which forces a value.  <br>

<br>Tully<br><br><div class="gmail_quote">2011/1/11 Nicolás Alvarez Picco <span dir="ltr"><<a href="mailto:nicolasapicco@hotmail.com">nicolasapicco@hotmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">





<div>
Hi!<br><br>I am using this code to get the position of my robo:<br><br><font color="#0070c0">p</font><font color="#0070c0">ose2d_t ROS_Link::get_robot_pose(){</font><font color="#0070c0"><br></font><font color="#0070c0">  pose2d_t ret;</font><font color="#0070c0"><br>

</font><font color="#0070c0"> </font><font color="#0070c0"><br></font><font color="#0070c0">  tf::StampedTransform transform;</font><font color="#0070c0"><br></font><font color="#0070c0">  geometry_msgs::TransformStamped msg;</font><font color="#0070c0"><br>

</font><font color="#0070c0"><br></font><font color="#0070c0">  std::string source_frame("/base_link");//!!este y el de abajo van!!!</font><font color="#0070c0"><br></font><font color="#0070c0">  std::string target_frame("/map"); //!! Ver q va bien aca!</font><font color="#0070c0"><br>

</font><font color="#0070c0"><br></font><font color="#0070c0"> </font><font color="#0070c0"> try{</font><font color="#0070c0"><br></font><font color="#0070c0">     ros::Time now = ros::Time::now();</font><font color="#0070c0"><br>

</font><font color="#0070c0">     </font><font color="#0070c0"><br></font><font color="#0070c0">     tl->waitForTransform(target_frame, source_frame, now, ros::Duration(1.0));</font><font color="#0070c0"><br></font><font color="#0070c0"><br>

</font><font color="#0070c0">     tl->lookupTransform(target_frame, source_frame, ros::Time::now(), transform);</font><font color="#0070c0"><br></font><font color="#0070c0">  } </font><font color="#0070c0"><br></font><font color="#0070c0">  catch(...){</font><font color="#0070c0"><br>

</font><font color="#0070c0">    ROS_ERROR("Error obtaining robot pose");</font><font color="#0070c0"><br></font><font color="#0070c0">    return ret;</font><font color="#0070c0"><br></font><font color="#0070c0">  }</font><font color="#0070c0"><br>

</font><font color="#0070c0"><br></font><font color="#0070c0">  tf::transformStampedTFToMsg(transform, msg);</font><font color="#0070c0"><br></font><font color="#0070c0"><br></font><font color="#0070c0">  ret.x = msg.transform.translation.x;</font><font color="#0070c0"><br>

</font><font color="#0070c0">  ret.y = msg.transform.translation.y;</font><font color="#0070c0"><br></font><font color="#0070c0">  ret.yaw = tf::getYaw(msg.transform.rotation);//!! WHY??</font><font color="#0070c0"><br></font><font color="#0070c0"><br>

</font><font color="#0070c0">  return ret;</font><font color="#0070c0"><br></font><font color="#0070c0">}</font><br><br>the robot is a a model from videre erratic simulated in gazebo. I am attaching the tf tree with the frecuencies. But every time I run my program I have the <font color="#0070c0">ROS_ERROR("Error obtaining robot pose"); <font color="#000000">and the time to time I get the position.<br>

So as I can see it is a problem of the speed of the transfomation. What can I do I have tried with more time in the wait for transform line?<br><br>Thanks<br><br>Nicolas<br></font></font><font color="#0070c0">
</font>                                     </div>
<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>Tully Foote<br>Systems Engineer<br>Willow Garage, Inc.<br><a href="mailto:tfoote@willowgarage.com">tfoote@willowgarage.com</a><br>(650) 475-2827<br>