Rosanswers logo


I'm looking for a way to transform coordinates from one from to another, but without setting up a broadcaster and listener. Is there a way to just call the transform function?

Or if I need the listener/broadcaster:

The tutorial I found in the ros wiki (http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF#Writing_Code) has coordinates being returned to the screen every second. I was looking for a way to do this one shot. But I am getting errors. When I set the one shot flag to true:

ros::Timer timer = n.createTimer(ros::Duration(1.0), boost::bind(&transformPoint, boost::ref(listener)),true)

(without a ros spin because I don't want the program to live forever) it returns a warning "Timer destroyed immediately after creation. Did you forget to store the handle?"

When I try calling the function by itself

boost::bind(&transformPoint, boost::ref(listener))

nothing happens.

And when I try to pass the listener

transformPoint(boost::ref(listener)) or transformPoint(listener)

it returns an error saying base_link doesn't exist.

Thanks for the help in advance.

Originally posted by robjime on ROS Answers with karma: 13 on 2011-11-22

Post score: 1


1 Answer 1


Rosanswers logo

You can use tf::Transform directly (see tf/Overview/Data Types), it is just a btTransform from the bullet library.

For instance, if you want to transform a single point, you can use the ()-operator:

tf::Point original_point = /*...*/;
tf::Transform transform = /*...*/;
tf::Point transformed_point = transform(original_point);

Originally posted by roehling with karma: 1951 on 2011-11-22

This answer was ACCEPTED on the original site

Post score: 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.