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

building open_gmapping from source on melodic/ubuntu 18.04

asked 2018-08-13 15:10:22 -0500

roboticslife gravatar image


The short version of my question is: How can I get gmapping running on Ubuntu 18.

I have been trying for a few days to get gmapping ( ) running on my system (Ubuntu 18/melodic). Since I have ubuntu 18 I cannot use apt-get since gmapping is only released for kinetic/lunar, and in separate issues I have not been able to build either kinetic or lunar from source as a way to avoid building gmapping from source).

Per the instruction on , I understand I need to first compile CARMEN ( ). I tried following the instructions on , but this references ubuntu 7 so I am not shocked it does not work. By googling each error that came up I was able to eventually get the ./configure command to complete without issue, but make fails with some pointer error in c files. Judging by how old the instructions I was following are I was thinking that there must be a better way to do this. The only "recent" reference to this processes I could find was a question asked regarding ubuntu 10 .

Does any one have any suggestions/ has anyone got gmapping working on Ubuntu 18?

Thanks in advance!

edit retag flag offensive close merge delete


Just a note:

I have not been able to build either kinetic or lunar from source as a way to avoid building gmapping from source

building ROS from source will not allow you to install additional packages using apt afterwards. It's all or nothing.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-14 02:24:33 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-08-14 02:45:04 -0500

gvdhoorn gravatar image

updated 2019-07-09 04:42:54 -0500

Edit: update (2019-07-09): it would appear that at least openslam_gmapping has been released into Melodic now by the "ROS Orphaned Package Maintainers" (see here).

That still leaves gmapping itself (ie: the ROS package), so building from source may still be necessary, but it seems that will be done as well (ros-perception/slam_gmapping#72).

Instead of using vanilla upstream, using the latest (Kinetic/Lunar released) patched sources from ros-perception/openslam_gmapping (linked from wiki/openslam_gmapping) built cleanly for me in a ros:melodic Docker container.

Adding ros-perception/slam_gmapping (linked from wiki/slam_gmapping) to that same workspace and building it resulted in a happy catkin_make.

$ docker run -it --rm ros:melodic
(docker) $ apt update
(docker) $ rosdep update
(docker) $ mkdir -p /ros_ws/src
(docker) $ cd /ros_ws
(docker) $ git clone src/openslam_gmapping
(docker) $ git clone src/slam_gmapping
(docker) $ rosdep install --from-paths src/ -i
(docker) $ catkin_make -DCMAKE_BUILD_TYPE=RelWithDebInfo

I've not tested whether it actually all runs, but the fact it still compiles is nice.

After this works, you might also want to take a look at some of the open pull requests against both ros-perception/openslam_gmapping (here) and ros-perception/slam_gmapping (here). They seem to propose a few enhancements and fixes especially for more recent systems and OS.

edit flag offensive delete link more



You are probably aware of this already, but please note the Maintainer status: unmaintained for gmapping. There are better systems out there now, so this will not receive any updates any more.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-14 02:47:47 -0500 )edit

Thanks for your help @gvdhoorn! I had seen the openslam_gmapping package, but I must have made another mistake that prevented it from compiling. With respect to your comment, I am also working with cartographer, but in order to compare results to a previous paper I unfortunately need gmapping too...

roboticslife gravatar image roboticslife  ( 2018-08-14 11:50:08 -0500 )edit

Question Tools

1 follower


Asked: 2018-08-13 15:10:22 -0500

Seen: 2,439 times

Last updated: Jul 09 '19