Ask Your Question
9

tf transformPoint() equivalent on tf2?

asked 2013-10-29 15:24:38 -0500

ssafarik gravatar image

updated 2015-06-19 03:34:20 -0500

BennyRe gravatar image

It used to be that, with tf, we would use a TransformListener and its transformDATA() methods, e.g.

import tf
listener = tf.TransformListener()
...
ptNew = listener.transformPoint('frameNew', ptOld)

but now with tf2 (i.e. tf2_ros), there doesn't seem to be a transformPoint(). The only place I can find something close is in tf2_geometry_msgs.do_transform_point(), which requires PyKDL (not installed by default with ROS). I can't find any docs on the api for the do_transform_DATA(), however, and I see that the code is called "geometry_experimental" on github. Am I just trying to use this before it's ready for prime time, or is there something I'm missing as far as docs and using the tf2 listener?

Edit: Bump. I'm also facing this problem.

edit retag flag offensive close merge delete

Comments

1

Is there an update on this? Transforming points from one coordinate system to the other is, for me, the essential use-case of tf2. But it seems that this is supported only poorly and documented even more poorly.

BennyRe gravatar image BennyRe  ( 2015-06-19 03:32:33 -0500 )edit

1 Answer

Sort by » oldest newest most voted
5

answered 2015-06-19 11:39:27 -0500

tfoote gravatar image

updated 2016-12-13 05:58:59 -0500

Procópio gravatar image

You can use the transform or transform_full methods from the BufferInterface on any datatype which implements do_transform

tf2 is now recommended. It is still in the geometry_experimental repository but only for legacy reasons.

edit flag offensive delete link more

Comments

1

hey @tfoote, I tried using the transform method to transform a stamped pose, and got this error: File "/opt/ros/indigo/lib/python2.7/dist-packages/tf2_ros/buffer_interface.py", line 43, in transform do_transform = self.registration.get(type(object_stamped))

Procópio gravatar image Procópio  ( 2016-12-14 02:09:21 -0500 )edit
1

File "/opt/ros/indigo/lib/python2.7/dist-packages/tf2_ros/buffer_interface.py", line 105, in get raise TypeException('Type %s if not loaded or supported'% str(key)) TypeException

Procópio gravatar image Procópio  ( 2016-12-14 02:09:39 -0500 )edit
5

For anyone that comes across this, to transform PoseStamped messages you can try installing ros-kinetic-tf2-geometry-msgs and then importing tf2_geometry_msgs

dhood gravatar image dhood  ( 2017-03-07 10:55:43 -0500 )edit

Is there an update on this? I am following this tutorial and can't figure out the tf2 equivalent of the listener.transformPoint() part, I tried including buffer_interface.h but the methods mentioned above were still not available

Alkrick gravatar image Alkrick  ( 2021-03-08 03:48:27 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2013-10-29 15:24:38 -0500

Seen: 5,271 times

Last updated: Dec 13 '16