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

possible error in tutorial tf/Tutorials/Writing a tf listener (C++)

asked 2014-07-10 04:22:37 -0500

lucaluca gravatar image

About the line:

listener.lookupTransform("/turtle2", "/turtle1", ros::Time(0), transform);

The tutorial says:

1 - We want the transform from this frame ...

2 - ... to this frame.

However, the documentation of Transformer::lookupTransform states that the first parameter is the target frame, while the second parameter is the source frame. Also, this information makes sense with the tutorial I think (we want to transform data in turtle1's reference frame to turtle2's reference frame).

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-07-10 11:56:54 -0500

McMurdo gravatar image

updated 2014-07-14 03:13:44 -0500

I agree with you. We aren't transforming from turtle2 to turtle1. In fact we are transforming the co-ordinates in turtle1 frame to turtle2 frame. More precisely when we "look up transform" we are transforming the pose defined by [position = origin of turtle1 frame, orientation = x axis of turtle1 frame] to the turtle2 frame.

Also, other functions such as transformPoint and transformPose transform a point/pose from the second parameter frame to the first parameter frame.

EDIT: This is a wrong answer. Please see comments to tfoote's answer.

edit flag offensive delete link more
0

answered 2014-07-10 14:37:34 -0500

tfoote gravatar image

The transform from frame A to frame B is the inverse of the transform to convert data in frame A into frame B.

edit flag offensive delete link more

Comments

So you're basically stating that that instruction finds a transformation from frame /turtle2 to frame /turtle1 and that this transformation converts data in frame /turtle1 into frame /turtle2? So for example the "source frame" in lookupTransform documentation means "data originally in this frame"?

lucaluca gravatar image lucaluca  ( 2014-07-10 15:30:16 -0500 )edit

@tfoote, what you have stated is convention? I am sorry, I do not have much theoretical background.

McMurdo gravatar image McMurdo  ( 2014-07-11 01:44:22 -0500 )edit

@McMurdo it is actually how theory works: if you write a transformation that transforms a reference system A into a reference system B, you can use it to convert data that is expressed using reference system B into data expressed into reference system A

lucaluca gravatar image lucaluca  ( 2014-07-11 07:29:10 -0500 )edit

Great thanks!

McMurdo gravatar image McMurdo  ( 2014-07-14 03:13:02 -0500 )edit

Question Tools

Stats

Asked: 2014-07-10 04:22:37 -0500

Seen: 177 times

Last updated: Jul 14 '14