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

Why would I want to transform a Pose in Frame A using a Transform From B to C?

asked 2020-06-15 13:43:58 -0600

aels gravatar image

Using a bit more detail,

Let's say I have a VectorStamped in with frame_id "A", and then I take a StampedTransform with frame_id "B" and child_id "C". It's perfectly valid ROS for me to use the transform on the vector, but I'm struggling to understand what is the use case or physical interpretation of this operation. I am new to ROS, but I've spoken with two more-experienced users who couldn't give me any reason why and told me it would be erroneous to do so. However, again, it's valid ROS, and documented in several places suggesting it's valid, such as here: http://paulfurgale.info/news/2014/6/9...

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2020-06-15 16:06:32 -0600

tfoote gravatar image

That does not sound like a correct application of the transform math and doesn't have a physical interpretation. The transform multiplication primitives are basically matrix operations and do not have checks that enforce frame semantics. You need to make sure that your logic is correct when you write your code.

Note that it's highly recommended to simply use the TransformListener and ask it to transform the data into the coordinate frame you would prefer, instead of manually doing the transform math yourself. That way you don't need to worry about the exact sequence of the transform multiplications the library does that all for you.

The link you point to isn't official documentation, and a first skim if it appears to be correct. Your problem statement above does not reflect what I read in that article.

edit flag offensive delete link more

Comments

Thanks much! This answered my question. Just wanted to sanity check to see if there was some use of this that I wasn't aware of, and it looks like that is not the case.

aels gravatar image aels  ( 2020-06-15 16:18:51 -0600 )edit
2

answered 2020-06-15 16:07:09 -0600

ffusco gravatar image

I will give you an answer assuming that when you say "using transforms on vectors" you mean that you use the operations exposed by something like tf. If this is not the case, comment below and I'll try to adapt the answer.

From a mathematical point of view, a transform with frame_id B and child_id C "contains" the pose of frame C expressed in the coordinate system of B (there are also other interpretations, but this is my favorite). The pose is commonly represented by the rotation matrix bRc and the translation vector bTc. If you take any vector expressed in C (namely, cV) you can obtain its coordinates in the frame B as: bV = bRc*cV + bTc. If you now take a vector expressed in an arbitrary frame A and do the same, the result probably does not have any geometric meaning. However, from a pure "operational" point of view, the operation is well defined: just multiply a matrix by a vector and sum the result to another vector. This "operational" step (the linear algebra bit) is what is actually implemented in C++/python libraries, eg, in tf::Transform (the code is the implementation of Transform*Vector). Since it works on a more "abstract" level (it really does just matrix multiplication, without knowing what the quantities represent) it cannot prevent you from doing "nonsense operations". Ensuring that what the program does really makes sense, is something that is left to you, the user :)

edit flag offensive delete link more

Comments

Thanks for the reply. There are certainly many ways of describing what a transformation represents, however, I am mainly interested in determining if the operation I describe in the question can ever have any physical interpretation or use case that I am ignorant of.

aels gravatar image aels  ( 2020-06-15 16:21:46 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-15 13:43:58 -0600

Seen: 732 times

Last updated: Jun 15 '20