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

Using robot_localization with amcl [closed]

asked 2015-09-23 09:43:34 -0600

Naman gravatar image

updated 2015-09-25 10:30:45 -0600

Hi all,

I am starting to set up awesome robot_localization package and I am using rotary encoders (nav_msgs/Odometry, both pose and twist) and IMU (sensor_msgs/Imu) which provides continuous data and Ultrawide band sensor which provides global absolute position data as a nav_msgs/Odometry message (only pose, (x,y and yaw)) . As suggested on the wiki page of the package, I can fuse data from the encoders and the IMU in the odom_frame which gives the transform odom_frame -> base_link_frame. For the map_frame, I can fuse data from rotary_encoders, IMU and Ultrawide band sensor (It is similar to GPS in the sense that it provides global absolute position data) and it gives the transfrom from map_frame -> odom_frame but next I am using amcl to improve the pose_estimate and amcl also provides map_frame->odom_frame transformation. So, I want to ask how should I deal with the transformations (specifically map_frame->odom_frame), Should I just not use the map_frame->odom_frame transformation from robot_localization and let amcl take care of it, If yes how can I not use the transformation? Or is there any better way to deal with it?

Update 1:
If I give output of AMCL and UWB to second instance of ekf_localization_node, it will give me the required transformation (map_frame -> odom_frame) and will publish the output odometry message on odometry/filtered topic but I am using move_base which expects robot pose on /amcl_pose topic. So, I can remap the output on odometry/filtered to amcl_pose and change the message type from nav_msgs/Odometry to geometry_msgs/PoseWithCovarianceStamped, Does that sound okay?

Also, another approach which I am thinking is to run the first instance of ekf_localization_node (in odom_frame) with rotary encoders and IMU as input which will give odom_frame->base_link_frame transformation and then run second instance of ekf_localization_node (in map_frame) with UWB, rotary encoders and IMU as input. I am slightly confused about how the second instance will work. Will it modify the odom_frame -> base_link_frame tf by considering (or changing) the data from UWB in the odom_frame? If yes, then I can directly use the modified odom_frame->base_link_frame tf (which includes UWB, encoders and IMU) (and ignore map_frame->odom_frame tf from second instance of ekf_localization_node) in amcl and everything should be fine, right?

Update 2:
Thanks @Tom Moore for the answer! So just to clarify, run the first instance of ekf_localization_node in odom_frame with wheel odometry and IMU data as input which will give us the odom_frame -> base_link_frame transformation. Then run the second instance of the ekf_localization_node in the map_frame with wheel odometry, IMU data, UWB data (it is in map_frame) and amcl_pose which will give us the map_frame -> odom_frame transformation using existing odom_frame -> base_link_frame tf.

Thanks in advance.
Naman Kumar

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by allenh1
close date 2015-09-26 12:54:32.391091

Comments

1

Re: edit 2, yes, sounds correct.

Tom Moore gravatar image Tom Moore  ( 2015-09-25 11:53:44 -0600 )edit

Thanks a lot! :)

Naman gravatar image Naman  ( 2015-09-25 11:56:57 -0600 )edit

@Naman In this case, How are you setting the initial pose in amcl? I mean do you use Rviz 2D Pose estimate or update the initial pose from UWB sensor as both are in map frame.

Punith gravatar image Punith  ( 2015-11-19 04:29:14 -0600 )edit

hi, dear @Naman, did you solve this issue in reality? I'm doing same study on real UAV, but got very bad effect. could you please instruct me on this? thank you very much!

asimay_y gravatar image asimay_y  ( 2016-06-14 11:56:00 -0600 )edit

dear @Naman, my issue is at here, i'm doing real experiment on UAV: http://answers.ros.org/question/23640...

asimay_y gravatar image asimay_y  ( 2016-06-14 11:56:59 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2015-09-24 07:25:24 -0600

Tom Moore gravatar image

updated 2015-09-25 07:40:28 -0600

One option would be to turn off the map->odom transform broadcast in amcl, and then include both amcl and the UWB sensor output as inputs to the second instance of ekf_localization_node. As long as they both report data in the same coordinate frame (or you provide the necessary transforms so they can), it should work.

If I give output of AMCL and UWB to second instance of ekf_localization_node, it will give me the required transformation (map_frame -> odom_frame) and will publish the output odometry message on odometry/filtered topic but I am using move_base which expects robot pose on /amcl_pose topic. So, I can remap the output on odometry/filtered to amcl_pose and change the message type from nav_msgs/Odometry to geometry_msgs/PoseWithCovarianceStamped, Does that sound okay?

Yes, that's really the point of topic remapping. I would advise not remapping the output of the EKF to /amcl_pose, because you're using /amcl_pose as an input to the filter. Instead, do the remapping within the launch file for move_base, such that move_base now expects /odometry/filtered.

As far as your second question, read the frame descriptions here. Both instances actually generate a transform from the world_frame to the base_link_frame, so internally, you have map->base_link and odom->base_link. But tf doesn't allow a frame to have two parents, so the second EKF instance automatically detects this situation (because world_frame and map_frame match) and uses its internal map->base_link transform, along with the existing odom->base_link transform that is broadcast by the first EKF instance, to produce a map->odom transform, which it then broadcasts. For your use case, I would make sure the UWB data has a frame_id of map.

edit flag offensive delete link more

Comments

Thanks @Tom Moore for the answer. I have updated my original question, Can you look at it. Thanks!

Naman gravatar image Naman  ( 2015-09-24 08:49:40 -0600 )edit

hi, dear @Tom Moore, i do as your instruction: 1. turn off map->odom tf transform in amcl; 2.include amcl_pose topic and /odometry/gps topic as input to the second ekf_localization_global node; 3. remap move_base odom topic to /odometry/filtered; but get very bad effect. could you please instruct me

asimay_y gravatar image asimay_y  ( 2016-06-12 01:40:05 -0600 )edit

Question Tools

7 followers

Stats

Asked: 2015-09-23 09:43:34 -0600

Seen: 5,612 times

Last updated: Sep 25 '15