Rosanswers logo

  1. What is the difference between robot_pose_ekf (package) and robot_localization. I have encoder odometry, lidar scan and imu sensor data.... How can we combine these sensor to get better localization and navigation. How can we do sensor fusion

  2. When we navigate our robot in map, what rviz or move_base use to localize robot position in map. Frames ( odom_frame etc) or amcl_pose topic.

For example , in order to calculate a distance between a robot and a point in map, what we will use ? amcl_pose or odom_frame?

trans = self.listener.lookupTransform(self.odom_frame_id,self.base_frame_id, now)
 distance = math.sqrt(pow(waypoint.pose.pose.position.x-trans[0],2)+pow(waypoint.pose.pose.position.y-trans[1],2))

or we will calculate this distance with subciring the amcl_pose

Originally posted by bfdmetu on ROS Answers with karma: 85 on 2020-11-29

Post score: 1


1 Answer 1


Rosanswers logo


My understanding is that robot_pose_ekf is a deprecated/orphaned package. Considering that, and how active the support for robot_localization is, you should use robot_localization. It does exactly what I think you are asking for and the wiki page is super well documented and there is a lot of discussion here on RA about how to setup and debug the package.

Personally I learned by installing the Clearpath Husky simulator and learning from there. You can see here in the husky_control package how they set up robot_localization to generate the transform from odom to base_link by fusing odom and imu measurements.


Generally, it is my understanding, that the tf tree should be used by every application that needs to understand its location. So in my opinion looking up transforms between things is a good way to find location, but may not translate perfectly into every single specific use case you can imagine.

Originally posted by JackB with karma: 977 on 2020-11-29

This answer was ACCEPTED on the original site

Post score: 3

Original comments

Comment by tryan on 2020-11-30:
To add to the second answer, you probably don't want to find the transform between odom_frame and base_frame if you're trying to calculate a distance on a map. The transform between map_frame and base_farme is generally more useful. The difference can be small, but odom_frame can move relative to the map.

Comment by bfdmetu on 2020-12-01:
Also amcl_pose topic publishes a coordinate system. Why we don't use amcl_pose topic to calculate distance.

Maybe there is a misconception in my head....

if i subscribe amcl_pose and take the x and y coordinate, will it equals the <map_frame and base_frame > calculation.

Another thing i confused ....

My odom file publish odom0 topic and odom_frame-->base_link transformation... My ekf file subscribe odom0 topic and imu/data topic and publish odom topic... And also publish odom_frame-->base_link transformation.

In that way 2 different node publish same transfer function odom_frame--> base_link... Is this right way or do i need to change frames name , tf.

Comment by tryan on 2020-12-01:
Using the amcl_pose topic is probably fine and should yield similar results for simple applications, but using the transform tree tends to be more versatile and robust; you can control the timing more easily for example.

Yes, renaming the frame(s) to avoid redundancy is a good idea. You will have issues if multiple sources publish conflicting transforms. Your robot may start jumping around the map.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.