0
$\begingroup$

I was going through the implementation of the lookupTransform function defined inside the base_local_planner::getGoalPose() function.

What is the significance of the fixed_frame parameter in tf2_ros::Buffer::lookupTransform (target_frame, target_time, source_frame, source_time, fixed_frame, timeout) function ?

The documentation mentions the following - Get the transform between two frames by frame ID assuming fixed frame.

What's preventing us to always go for the other implementation of the lookupTransform function - tf2_ros::Buffer::lookupTransform (target_frame, source_frame, time, timeout) ?

$\endgroup$
2
$\begingroup$

From what I understand, the fixed frame is one where objects are assumed to be stationary with time. Maybe an example will make this clear:

Assume a robot with a lidar sensor moving in your world. It spits out a laserscan in the /lidar frame. The goal pose might be in an /odom frame. Now, if you encounter objects in the /lidar frame, your navigation stack has to transform them into the /odom frame (using lookuptransform). Maybe you are also mapping the environment in a /map frame (which could be your fixed frame in this case). If an object is staitonary (like a rock), you could transform it using the fixed frame (/map) since it is not going to change its position in the world.

Such transforms can help estimate the location of objects around the robot into the future.

$\endgroup$
2
  • $\begingroup$ What would be the values of target_frame and source_frame in your example? $\endgroup$
    – skpro19
    Jul 14 at 21:40
  • $\begingroup$ source frame might be /lidar, target frame might be /odom and fixed frame might be /map $\endgroup$ Jul 15 at 16:15
1
$\begingroup$

An example use case: "For example if one wants to know what was the position of the right arm two seconds ago relative to the position the left arm has now"

Here we have two different time stamps, and in order to calculate the two different positions at these times, we need a separate reference frame:

lookupTransform("LeftArmFrame", t, "RightArmFrame", t-Duration(2), "RobotFrame");
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.