Robotics StackExchange | Archived questions

Confusion in understanding TFs published by robot_localization package

I was going through the robot localization's wiki page: http://docs.ros.org/en/noetic/api/robotlocalization/html/stateestimation_nodes.html. There, the working of code/ different parameters is explained. Below are two excerpts which I found relevant in understanding how the package publishes TFs between different frames.

~publish_tf

If true, the state estimation node will publish the transform from the frame specified by the worldframe parameter to the frame specified by the baselink_frame parameter. Defaults to true.

And if you scroll down a bit, you find this

Published Transforms

If the user’s world_frame parameter is set to the value of odom_frame, a transform is published from the frame given by the odom_frame parameter to the frame given by the base_link_frame parameter.

If the user’s world_frame parameter is set to the value of map_frame, a transform is published from the frame given by the map_frame parameter to the frame given by the odom_frame parameter.

Note: This mode assumes that another node is broadcasting the transform from the frame given by the odom_frame parameter to the frame given by the base_link_frame parameter. This can be another instance of a robot_localization state estimation node.

To me, these sound contradictory. Let me try to explain this using an example.

I have two ekf_nodes

1.  map_frame: map                   
    odom_frame: odom               
    base_link_frame: base_link  
    world_frame: odom

From the definition of publish_tf parameter, it should publish a tf from odom to base_link which is also supported by first point in Published Transforms section.

2.  map_frame: map
    odom_frame: odom
    base_link_frame: base_link
    world_frame: map

For this setup, using definition of publish_tf parameter, it should publish a tf from map (worldframe) to `baselink(base_link_frame) but as per second point of thePublished Transformssection, a tf is published frommap(map_frame) toodom(odom_frame) which seems contradictory to me. Between which frames is the package publishing the TFs? Also, ifpublish_tf` parameter clearly guides the tf between different frames which package will work upon, what is the need to provide an extra if-else condition?

Please help. Thanks in advance.

Asked by dvy on 2022-08-05 15:15:45 UTC

Comments

Answers