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

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

asked 2019-01-25 14:12:15 -0600

turtlebot3 gravatar image

updated 2019-01-25 17:51:32 -0600

This is my first time using ROS. I'm using ubuntu 18.04 and ROS-melodic on my remote (PC) and ROS-kinetic on my turtlebot (pc). I'm trying to run on my Remote (PC)

(roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping)

But I get this error!!!!

process[robot_state_publisher-1]: started with pid [54409]
ERROR: cannot launch node of type [gmapping/slam_gmapping]: can't locate node [slam_gmapping] in package [gmapping]
process[rviz-3]: started with pid [54410]
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
[robot_state_publisher-1] process has finished cleanly
log file: /home/kaos5-q/.ros/log/2a9e2d58-20d8-11e9-ba50-7085c28192a9/robot_state_publisher-1*.log
libpng warning: iCCP: known incorrect sRGB profile

image description

How can fix this??

Further Work

  • We tried adding the path of gmapping to the ROS environment to check if it works

    export ROS_PACKAGE_PATH=/home/kaos5-q/catkin_ws/src:/home/kaos5-q/catkin_ws/src/turtlebot3_msgs:/opt/ros/melodic/share:/home/kaos5-q/catkin_ws/src/slam_gmapping/gmapping

  • This is what looks like now!
  • After I ran, source ~/.bashrc Is this what you mean by sourcing??
edit retag flag offensive close merge delete

Comments

Do you have the gmapping package installed?

jayess gravatar image jayess  ( 2019-01-25 15:12:37 -0600 )edit

Yes I have gmapping installed! I believe this is a problem with Ros/environment variables. Setting a ros path for gmapping. That's my assumption. I'm new to ROS, excuse my ignorance.

turtlebot3 gravatar image turtlebot3  ( 2019-01-25 15:37:22 -0600 )edit

How did you install it? From source or using apt?

jayess gravatar image jayess  ( 2019-01-25 15:38:16 -0600 )edit

I installed it from source.

turtlebot3 gravatar image turtlebot3  ( 2019-01-25 15:43:51 -0600 )edit

Why did you install from source? You should install the binary using apt instead.

jayess gravatar image jayess  ( 2019-01-25 15:45:37 -0600 )edit

I tried at first with the binary using apt but it didn't work. I searched on google why it didn't work and it's because the package has not been released from the melodic release page. I used this website https://answers.ros.org/question/2961...

turtlebot3 gravatar image turtlebot3  ( 2019-01-25 15:55:43 -0600 )edit

OK, that makes sense then. Are you sourcing the workspace in where the package resides and was compiled?

jayess gravatar image jayess  ( 2019-01-25 16:12:13 -0600 )edit

I've edited my question a little. I tried to source how you said and it still doesn't work. I'm doing something wrong in here.

turtlebot3 gravatar image turtlebot3  ( 2019-01-25 17:52:41 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2019-01-25 18:29:16 -0600

jayess gravatar image

updated 2019-01-25 18:31:43 -0600

You should take a look at the catkin tutorials. You need to source your workspace.

I'm assuming that you compiled your workspace using

catkin_make

from the root of your workspace (e.g., ~/catkin_ws).

Anytime that you open a new terminal, you need to source two files: the setup.bash for your ROS distribution and the setup.bash for your workspace. It looks like you've already sourced your distribution's setup.bash, now you just need to do the same for your workspace. Again, assuming that the root of your workspace is at ~/catkin_ws and you are in that directory, then you run

source devel/setup.bash

and then ROS should be able to find your compiled gmapping package and the node(s) that you're using. Now your ROS_PACKAGE_PATH environment variable should be set. I've never had to set this on my own.

edit flag offensive delete link more

Comments

Perfect!! It worked

turtlebot3 gravatar image turtlebot3  ( 2019-01-28 06:38:07 -0600 )edit

I already did these things but didn't work.

123nusri@gmail.com gravatar image 123nusri@gmail.com  ( 2020-08-12 01:08:15 -0600 )edit
6

answered 2020-09-13 12:17:04 -0600

joaoquintas gravatar image

For some reason, I got this error because I didn't make the correct installation of ros-melodic-slam-gmapping. After installing the dependency the error went away.

$ sudo apt-get install ros-melodic-slam-gmapping
edit flag offensive delete link more

Comments

This works well with noetic as well:

$ sudo apt-get install ros-noetic-slam-gmapping
osilva gravatar image osilva  ( 2021-09-08 14:15:16 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-01-25 14:12:15 -0600

Seen: 15,671 times

Last updated: Sep 13 '20