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

Hi, I am trying to read the raw data from sick s300 using cob_sick_s300 package. I am getting the error

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


while launching the launch file,

s300_launch.launch

<launch>
<!-- start laser driver -->
<node name="laser" pkg="cob_sick_s300" type="cob_sick_s300" respawn="false" output="screen">
</node>
</launch>


the s300 configuration file is,

s300_config.yaml
port: /dev/ttyUSB0
baud: 500000
scan_duration: 0.025 #no info about that in SICK-docu, but 0.025 is believable and looks good in rviz
scan_cycle_time: 0.040 #SICK-docu says S300 scans every 40ms
inverted: false
scan_id: 7
scan_intervals: [[-1.3526, 1.361357]] #[rad] these intervals are included to the scan
fields:
'1':
scale: 0.01
start_angle: -2.355
stop_angle: 2.355
# '2':
#  scale: 2.0
# start_angle: -11.0
#stop_angle: 12.0


I got the same error while launching amcl_diff.launch

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


But i resolved this by putting the command

source /opt/ros/kinetic/setup.bash


But if i put this command for this. the package is not in the rospack list. Again i have to reinitialize the source devel/setup. how can i clear this error? Your assistance is always much appreciated. thank u!

edit retag close merge delete

Sort by » oldest newest most voted

In each terminal you need to make sure that you source setup.bash file that's found in the /opt/ros/<distro>/ directory and the setup.bash file that's found in the devel space of your workspace. Otherwise, ROS won't be able to find your packages. So, in each terminal that you use run

source /opt/ros/<distro>/setup.bash # replace <distro> with the version of ROS you're using


and from the root of your workspace

source devel/setup.bash


Many people prefer to put the first command in their .bashrc file so ROS is is automatically sourced. If you are only using one workspace then you can also put the second command in your .bashrc file so it's automatically sourced as well. Just make sure to put the actual path to the setup.bash file such as

source ~/catkin_ws/devel/setup.bash


if your workspace is in a directory called ~/catkin_ws.

more

@jayess Thanq so much for your contribution and for your valuable time :).

( 2019-05-24 00:56:20 -0600 )edit

The problem I faced is, When I put this - source /opt/ros/kinetic/setup.bash and - source devel/setup.bash I am getting the error - ERROR: cannot launch node of type [cob_sick_s300/cob_sick_s300]: can't locate node [cob_sick_s300] in package [cob_sick_s300] After that if I call this again - source /opt/ros/kinetic/setup.bash I am getting this error - [s300_launch.launch] is neither a launch file in package [cob_sick_s300] nor is [cob_sick_s300] a launch file name The traceback for the exception was written to the log file. But I already cleared this error by calling this, source /opt/ros/kinetic/setup.bash Is there any missing in the workspace. how can i make the package to access globally? Your assistance is always appreciated.

Thank u!

( 2019-05-24 01:14:26 -0600 )edit

You need to give the full path to your workspace, like I show at the bottom of the answer. Also, in the future, please give extra information as an update to your question instead of as a comment. It's very difficult to read a block of unformatted text like that and others may miss information in comments.

( 2019-05-24 02:25:49 -0600 )edit

Thanq so much sir for your valuable time. And I will update in proper way thank u!

( 2019-05-24 03:48:46 -0600 )edit

Hi I have a question for ask you. Can the sicks300 package or cob_sick_s300 be ues for the s300 expert sensor? Thank you for answer my question.

( 2019-07-18 04:36:03 -0600 )edit

@thitapa.sae You should ask this as a question instead of a comment, that's not what comments are for

( 2019-07-18 11:31:22 -0600 )edit

Oh I'm so sorry,That's first time for me. Could you see my topic and advice me? Thank you very much!

( 2019-07-18 21:52:12 -0600 )edit

I solved the error by installing the cob_sick_s300 directly into the /opt/ros/kinetic/share by,

sudo apt-get install ros-kinetic-cob-sick-s300


After install this you can call

source /opt/ros/kinetic/setup.bash


now u can check the file path of your cob_sick_s300 by

rospack list


u can see in the list of rospack

cob_sick_s300 /opt/ros/kinetic/share/cob_sick_s300


if all the above things worked as like mentioned above, connect your LIDAR open another terminal and run

roscore


then open ur current terminal and run

rosrun cob_sick_s300 cob_sick_s300


then it should work. thank u! special thanks to @jayess for the fast response :).

more