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

How to use resulting map, odom frame data from ekf filter of robot_localization package

asked 2015-12-17 07:22:49 -0500

Double X gravatar image


I’m working on a custom built robot and I’m trying to position the robot in known map as well as control it in order to go from A to B. I found robot localization to be exactly what I need for my project but I have some issue with understanding how robot localization works (I read most of forums posts on but cannot find explicit answer to my concerns). To be more precise I’m having trouble understanding which node instance output to use for localization in case of two EKF instance example (odom or map)?

I am fusing wheel encoder and IMU in odom frame, and also in another instance of robot localization EKF node I am fusing wheel encoder, IMU and UWB in the map frame. I’m using UWB instead of GPS - I have this with guaranteed 3Hz update rate and it supplies x and y coordinates in world frame. As a result, I have two estimates of the robot’s position in two resulting frames (map and odom). As I understand, the map -> odom transformation is constantly being computed and published and is not constant due to a drift in odom frame, and discrete jumps in map frame. I also understand (from forum posts) that odom frame output is continuous and thus better suited for control. Is there any example of how to integrate robot localization in control loop?

The question is which data to use for localization? Are the two frames in any way connected/communicating in the background (except for transform update)? Due to 3Hz update rate could I get away only with odom frame output (other sensors have 25Hz update rate) which would also include UWB readings?

I would greatly appreciate any help of pointers in the right direction. Thank you in advance.

Best regards,

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-02-05 08:54:30 -0500

Tom Moore gravatar image

I find it's better to think about them as totally separate. In reality, both filters are doing the same thing: estimating your pose in some world frame. The map and odom frames are similar in that they are both global frames, so in a perfect world, your pose would be the same in both. What the odom and map filter instances are doing is creating transforms from odom->base_link and from map->base_link, respectively. tf represents your transforms as a tree, though, so we can't have two parents to base_link. To get around this, the map instance of ekf_localization_node looks up the transform from odom->base_link that the odom instance of the EKF is generating, and uses that transform, along with its own (internal, unpublished) map->base_link transform, to generate a map->odom transform. This means you can still transform from map->base_link in other nodes that may require it.

As to what you do with each estimate, that's up to you. If you want the most accurate answer to the question "where is my robot?", then I would use the map instance output. If you want a pose estimate that is not going to suddenly jump, then you want the odom instance.

edit flag offensive delete link more


Thnx for answering :) the problem is solved

Double X gravatar image Double X  ( 2016-02-10 08:43:41 -0500 )edit

This makes perfect sense. Thanks

josephjoel3099 gravatar image josephjoel3099  ( 2022-07-19 02:36:28 -0500 )edit

Question Tools

1 follower


Asked: 2015-12-17 07:22:49 -0500

Seen: 2,443 times

Last updated: Feb 05 '16