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

Localization, using robot_localization and robot_pose_ekf

asked 2020-11-29 03:46:36 -0500

bfdmetu gravatar image

updated 2020-12-01 09:22:39 -0500

tryan gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2020-11-29 10:16:39 -0500

JackB gravatar image

1)

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.

2)

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.

edit flag offensive delete link more

Comments

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.

tryan gravatar image tryan  ( 2020-11-30 08:56:37 -0500 )edit

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="" &gt;="" calculation.<="" p="">

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.

bfdmetu gravatar image bfdmetu  ( 2020-12-01 00:18:50 -0500 )edit
1

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.

tryan gravatar image tryan  ( 2020-12-01 09:18:32 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-11-29 03:46:36 -0500

Seen: 1,311 times

Last updated: Nov 29 '20