The problem of Transformer::lookupTransform
Recently, I follow the tf tutorial and try to understand the frame transformation in ROS. But I'm confusing about the API Transformer::lookupTransform
and tf_echo
First, the usage of tf_echo is shown below.
Usage: tf_echo source_frame target_frame
This will echo the transform from the coordinate frame of the source_frame to the coordinate frame of the target_frame.
So it is clear, I will get the transform that from source_frame to target_frame. I also confirmed it in turtlesim. However, when I saw the tutorial for tf_echo. They say the tf_echo
will return "the transform of the turtle2 frame with respect to turtle1 frame". In other words, I should get the transform from target frame
to source frame
. It is not correct since I verified from the turtlesim.
I wen to see how to get transform. It is clear that in tf_echo.cpp. Everything is fine except this line.
echoListener.tf.lookupTransform(source_frameid, target_frameid, ros::Time(), echo_transform);
I compare this line with the API document.
void Transformer::lookupTransform ( const std::string & target_frame,
const std::string & source_frame,
const ros::Time & time,
StampedTransform & transform
)
With my inspection, Transformer::lookupTransform
will get the transform that from target_frame to source_frame(API naming). However, for some reason, tf_echo swap the these frames. My questions are:
1)What is the meaning of source frame and target frame?
2)Why the usage of tf_echo is different from tutorial
3)Why tf_echo swap the arguments?