ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

tf listener/broadcaster

asked 2011-11-22 14:12:45 -0600

robjime gravatar image

Hi,

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-11-22 18:50:29 -0600

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);
edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-11-22 14:12:45 -0600

Seen: 538 times

Last updated: Nov 22 '11