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

Error launching Gmapping node on ROS

asked 2018-12-11 22:47:32 -0600

AlexR gravatar image

updated 2018-12-13 22:20:18 -0600


I am using ROS kinetic on ubuntu 16 and have installed the binaries for openslam and slam_gmapping using the command

sudo apt-get install ros-kinetic-slam-gmapping and sudo apt-get install ros-kinetic-openslam-gmapping.

However, whenever I am trying to use the gmapping node with ROS, it always throws the following error

ERROR: cannot launch node of type [gmapping/slam_gmapping]: can't locate node [slam_gmapping] in package [gmapping]

I am unable to figure out how do I solve this problem. My environment variables are properly defined in the bashrc.


Edit 1:

dpkg -l | grep gmapping 

dpkg -l | grep gmapping
ii  ros-kinetic-gmapping                         1.3.10-0xenial-20181117-012312-0800                        amd64        This package contains a ROS wrapper for OpenSlam's Gmapping.
ii  ros-kinetic-openslam-gmapping                0.1.2-0xenial-20180809-134859-0800                         amd64        ROS-ified version of gmapping SLAM.
ii  ros-kinetic-slam-gmapping                    1.3.10-0xenial-20181117-032709-0800                        amd64        slam_gmapping contains a wrapper around gmapping which provides SLAM capabilities.

Edit 2:

My environment is set as follows: all binary packages installed in


and my custom package are inside


the last two lines in my bashrc contains the following lines:

source /opt/ros/kinetic/setup.bash
source /home/arav/catkin_ws/devel/setup.bash

The gmapping works when i do source /opt/ros/kinetic/setup.bash. and rosrun gmapping slam_gmapping But my gmapping.launch is inside the catkin_ws, so when I source ~/catkin_ws/devel/setup.bash or source ~/.bashrc, the gmapping does not work ad gives the ERROR.

Edit 3:

Following @gvdhoorn's advice I cleaned my catkin_ws workspace by removing devel and build folders and catkin_make again. This partially solved the problem of finding the slam_gmapping node. However, I am getting a new error now. P.S. gmapping still does not work.

process[gmapping-2]: started with pid [23549]
/opt/ros/kinetic/lib/gmapping/slam_gmapping: symbol lookup error: /opt/ros/kinetic/lib/gmapping/slam_gmapping: undefined symbol: _ZN8GMapping14sampleGaussianEdj
[gmapping-2] process has died [pid 23549, exit code 127, cmd /opt/ros/kinetic/lib/gmapping/slam_gmapping __name:=gmapping __log:=/home/arav/.ros/log/f518ac08-ff53-11e8-a0af-a0d3c148ec01/gmapping-2.log].
log file: /home/arav/.ros/log/f518ac08-ff53-11e8-a0af-a0d3c148ec01/gmapping-2*.log
edit retag flag offensive close merge delete


What is the output of dpkg -l | grep gmapping?

gvdhoorn gravatar image gvdhoorn  ( 2018-12-12 00:24:00 -0600 )edit

hi, grep | gmapping gives :

gmapping: command not found

but when I run : rospack gmapping it returns /opt/ros/kinetic/share/gmapping

AlexR gravatar image AlexR  ( 2018-12-12 07:11:25 -0600 )edit

You must run the full command: dpkg -l | grep gmapping.

gvdhoorn gravatar image gvdhoorn  ( 2018-12-12 07:12:57 -0600 )edit

Hi Thanks Yes I ran the full command and the result is same :

gmapping: command not found
AlexR gravatar image AlexR  ( 2018-12-12 07:51:04 -0600 )edit

Hi I edited the question, also sorry for the previous comment I put a wrong command for grep gmapping please check edit1 for the grep result.

AlexR gravatar image AlexR  ( 2018-12-12 07:57:31 -0600 )edit

So then the question becomes: are the actual files installed.

What is the output of ls -al /opt/ros/kinetic/lib/gmapping?

If the slam_gmapping binaries are there, try running a rospack profile and then try the launch file again.

gvdhoorn gravatar image gvdhoorn  ( 2018-12-12 08:16:21 -0600 )edit

$ ls -al /opt/ros/kinetic/lib/gmapping

total 944
drwxr-xr-x   2 root root   4096 12月  7 13:00 .
drwxr-xr-x 213 root root  36864 12月 10 10:06 ..
-rwxr-xr-x   1 root root 418184 11月 17 18:33 slam_gmapping
-rwxr-xr-x   1 root root 496296 11月 17 18:33 slam_gmapping_replay
AlexR gravatar image AlexR  ( 2018-12-12 08:20:09 -0600 )edit

rosrun gmapping slam_gmapping gives the same error that slam_gmapping node not found.

AlexR gravatar image AlexR  ( 2018-12-12 08:22:54 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-12-13 07:52:37 -0600

gvdhoorn gravatar image

updated 2018-12-16 07:54:15 -0600

Ok. It looks like something didn't work when you last built your catkin_ws.

In a fresh terminal:

rm -rf $HOME/catkin_ws/build $HOME/catkin_ws/devel
source /opt/ros/kinetic/setup.bash
cd $HOME/catkin_ws
source $HOME/catkin_ws/devel/setup.bash

At this point things should work.

edit flag offensive delete link more


Hi thanks, I do not have access to the PC right now, I will report back tomorrow. Many thanks.

AlexR gravatar image AlexR  ( 2018-12-13 08:28:35 -0600 )edit

Hi, @gvdhoorn, This partially solved my problem, but I am getting a new error now. Please see Edit 3 in the question. Gmapping still does not work.

AlexR gravatar image AlexR  ( 2018-12-13 22:19:36 -0600 )edit

Do you have slam_gmapping or openslam_gmapping packages in your catkin_ws?

ahendrix gravatar image ahendrix  ( 2018-12-13 23:25:44 -0600 )edit

No I don't have them in catkin_ws.

AlexR gravatar image AlexR  ( 2018-12-13 23:33:08 -0600 )edit

So if we want to be strict, you should now accept my comment with the steps to properly (re)build your workspace as the answer. We've solved the issue of roslaunch complaining of not being able to find the gmapping nodes.

It's bad form to edit a question with a follow-up question.

gvdhoorn gravatar image gvdhoorn  ( 2018-12-14 08:48:13 -0600 )edit

Hi @gvdhoorn, please add that as an answer. I will post another question for the new problem. Thanks.

AlexR gravatar image AlexR  ( 2018-12-15 23:33:21 -0600 )edit

Question Tools

1 follower


Asked: 2018-12-11 22:47:32 -0600

Seen: 1,555 times

Last updated: Dec 16 '18