Rosanswers logo

We are trying to use robot_localization and gmapping. What we have done so far: we use gmapping to publish the transform between map -> odom. Then we tried to apply gps, imu and odom using ekf from robot_localization. We use navsat_transform and one ekf node to fuse all the data. This node does odom -> base_link transform. This setting does not work very well.

Here: https://roscon.ros.org/2015/presentations/robot_localization.pdf (page 4) there is a picture: localization and navigation http://slideplayer.com/slide/8827261/26/images/4/robot_localization+and+the+ROS+Navigation+Stack.jpg

This indicates, that I should fuse gmapping and navsat_transform result in one localization node. Should this be done? How should it be done? Is there an example of it?

Originally posted by Ago on ROS Answers with karma: 23 on 2017-08-22

Post score: 1

Original comments

Comment by juanlu on 2017-08-23:
Can you tell us how are you configuring gmapping and robot_localization? Specifically the parameters base_frame and odom_frame in gmapping and the parameter base_link_frame in robot_localization.

Also, have you tried other robot_localization packages? like robot_pose_ekf for example.

Comment by Humpelstilzchen on 2017-08-23:
As explained in the presentation video: The upper is a either-or relation. So you fuse either gmapping or amcl or navsat_transform. This is because all these nodes provide an absolute position.

Comment by Ago on 2017-08-23:
Haven't tried robot_pose_ekf. base frame is base_footprint, odom frame is odom. In robot_localization, base_link_frame is base_footprint. About Humpelstilzchen's comment, how could I use laser and gps together?

Comment by Deep on 2017-10-14:
I am have the same issue. Any help please.

Comment by Robbe_C on 2018-04-02:
Hey, Ago and Deep, did you get your setup to work?


1 Answer 1


Rosanswers logo

That's a pretty complex configuration! You're not fusing the gmapping output into the EKF in some way, are you?

This is also probably not going to play well with loop closure, unless you have a GPS with high accuracy.

In any case, it's almost impossible to make a determination about what's not working in your setup without at least your launch files and sample input messages.

Originally posted by Tom Moore with karma: 13689 on 2017-10-03

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by Robbe_C on 2018-04-08:
Hello Tom Moore

How would you handle this problem if you had gmapping, imu and GPS? Is it possible to use the gmapping with a gps? or do you have to choose between them?

Comment by Tom Moore on 2018-04-09:
The problem is that your map frame will constantly be shifting any time gmapping closes a loop, so the navsat_transform_node transform to your world frame will be constantly invalidated. Once you have a map, then you can use GPS data, I suppose, but only after you localize in the map.

Comment by Robbe_C on 2018-04-09:
Ok, thanks for the reply! If I understand it correctly, it's not a good idea to use gps in combination with gmapping. Is it a better idea to use a combination of gmapping and imu if the laser scanner data is available and use gps in combination with imu if it's not available?

Comment by Tom Moore on 2018-04-12:
The answer to this is far too long to put in a comment, I'm afraid. Please ask a separate question. Thanks.

Comment by Robbe_C on 2018-04-12:
Ok, I have posted my question: https://answers.ros.org/question/288429/how-to-set-up-robot_localization-with-gmapping-imu-and-gps/


Your Answer

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