0
$\begingroup$

Rosanswers logo

Hi,

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.

Thanks

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

/opt/ros/kinetic/share

and my custom package are inside

~/catkin_ws/src 

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

Originally posted by AlexR on ROS Answers with karma: 654 on 2018-12-11

Post score: 0


Original comments

Comment by gvdhoorn on 2018-12-12:
What is the output of dpkg -l | grep gmapping?

Comment by AlexR on 2018-12-12:
hi, grep | gmapping gives :

gmapping: command not found

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

Comment by gvdhoorn on 2018-12-12:
You must run the full command: dpkg -l | grep gmapping.

Comment by AlexR on 2018-12-12:
Hi Thanks Yes I ran the full command and the result is same :

gmapping: command not found

Comment by AlexR on 2018-12-12:
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.

Comment by gvdhoorn on 2018-12-12:
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.

Comment by AlexR on 2018-12-12:
$ 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

Comment by AlexR on 2018-12-12:
rosrun gmapping slam_gmapping gives the same error that slam_gmapping node not found.

Comment by gvdhoorn on 2018-12-12:
I'm guessing that you ran rospack profile after having source /opt/ros/kinetic/setup.bash before trying anything else. Correct?

Could you please be very specific in what you've done when reporting about results. I cannot guess what you're seeing or doing.

Comment by AlexR on 2018-12-13:
Sorry for that. following your advice I can find the slam_gmapping node. Sourcing the catkin_ws/devel/setup.bash, I am getting the error back again since all my packages are in catkin. I have them both in my bashrc so I think the problem is of workspace overlaying. How do I solve this, Thanks

Comment by gvdhoorn on 2018-12-13:
You have two workspaces? Can you tell us how you set things up?

If you source /opt/ros/kinetic/setup.bash, do the gmapping pkgs work then?

Comment by AlexR on 2018-12-13:
No I just have one workspace i.e. catkin_ws/src where I put all other packages. Rest all other packages are binary installed so they are inside the /opt/ros/kinetic/share . The gmapping works when i do source /opt/ros/kinetic/setup.bash. Plz see Edit 2 in the question I updated. Thanks

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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
catkin_make
source $HOME/catkin_ws/devel/setup.bash

At this point things should work.


Originally posted by gvdhoorn with karma: 86574 on 2018-12-13

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by AlexR on 2018-12-13:
Hi thanks, I do not have access to the PC right now, I will report back tomorrow. Many thanks.

Comment by AlexR on 2018-12-13:
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.

Comment by ahendrix on 2018-12-14:
Do you have slam_gmapping or openslam_gmapping packages in your catkin_ws?

Comment by AlexR on 2018-12-14:
No I don't have them in catkin_ws.

Comment by gvdhoorn on 2018-12-14:
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.

Comment by AlexR on 2018-12-16:
Hi @gvdhoorn, please add that as an answer. I will post another question for the new problem. Thanks.

$\endgroup$

Your Answer

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