Advertisement
Briansmith61

waitForTransform

May 5th, 2014
886
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1.  while (nh.ok())
  2.   {
  3.     try
  4.     {
  5.         //ROS_INFO("Attempting to read pose...");        
  6.         ros::Time now=ros::Time::now();
  7.     listener.waitForTransform("/map","/base_link",now,ros::Duration(1.0));
  8.         ROS_INFO("Got a transform! x = %f, y = %f",transform.getOrigin().x(),transform.getOrigin().y());
  9.     }
  10.     catch (tf::TransformException ex)
  11.     {
  12.         ROS_ERROR("Nope! %s", ex.what());
  13.     }
  14.  
  15.  
  16.     //rate.sleep();
  17.  
  18.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement