It is my understanding that tf2's use of PyKDL to do transformations means that the position and orientation construct a classic transformation matrix:
T = [[ M, p],
[ 0, 1]]
When this type of transformation is applied to a point, the rotation of the point happens first, then the point is translated in the new rotated frame. It took me several hours of digging in the source code to determine this behavior. My personal definition of a reference frame is that it is the opposite order -- translation first then rotation -- as opposed to frame being synonymous with transform.
This is not necessarily a problem with tf2 BUT caused great headaches trying to understand how to define a frame because the ros2 tf2 tutorials only use translations when defining the frame and use the identity quaternion making it ambiguous which order the operations are applied from just the tutorials.
Moreover, this same behavior is evident when using the function do_transform_pose. That function treats the pose as a transform/frame. This means that a transform's position is defined IN THE ROTATED COORDINATE FRAME i.e. AFTER applying the pose's rotation. Personally, I dislike this definition since now the position is coupled with the orientation. Defining pose as first a translation then a rotation would decouple the two. But since that path is unlikely to ever be realized, I would greatly appreciate some enhanced documentation and/or clarification on my misunderstandings.
It is my understanding that
tf2
's use ofPyKDL
to do transformations means that the position and orientation construct a classic transformation matrix:When this type of transformation is applied to a point, the rotation of the point happens first, then the point is translated in the new rotated frame. It took me several hours of digging in the source code to determine this behavior. My personal definition of a reference frame is that it is the opposite order -- translation first then rotation -- as opposed to frame being synonymous with transform.
This is not necessarily a problem with tf2 BUT caused great headaches trying to understand how to define a frame because the ros2 tf2 tutorials only use translations when defining the frame and use the identity quaternion making it ambiguous which order the operations are applied from just the tutorials.
Moreover, this same behavior is evident when using the function
do_transform_pose
. That function treats the pose as a transform/frame. This means that a transform's position is defined IN THE ROTATED COORDINATE FRAME i.e. AFTER applying the pose's rotation. Personally, I dislike this definition since now the position is coupled with the orientation. Defining pose as first a translation then a rotation would decouple the two. But since that path is unlikely to ever be realized, I would greatly appreciate some enhanced documentation and/or clarification on my misunderstandings.