Ask Your Question
0

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

asked 2019-05-23 04:03:47 -0500

KrishKannan_007 gravatar image

updated 2019-05-23 13:00:42 -0500

jayess gravatar image

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">
        <rosparam command="load" file="$(find cob_sick_s300)/ros/src/s300_config.yaml"/>
    </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
frame_id: /base_link
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 flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-05-23 13:20:41 -0500

jayess gravatar image

updated 2019-05-24 02:23:02 -0500

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.

edit flag offensive delete link more

Comments

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

KrishKannan_007 gravatar imageKrishKannan_007 ( 2019-05-24 00:56:20 -0500 )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!

KrishKannan_007 gravatar imageKrishKannan_007 ( 2019-05-24 01:14:26 -0500 )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.

jayess gravatar imagejayess ( 2019-05-24 02:25:49 -0500 )edit

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

KrishKannan_007 gravatar imageKrishKannan_007 ( 2019-05-24 03:48:46 -0500 )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.

thitapa.sae gravatar imagethitapa.sae ( 2019-07-18 04:36:03 -0500 )edit

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

jayess gravatar imagejayess ( 2019-07-18 11:31:22 -0500 )edit

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

https://answers.ros.org/question/3288...

thitapa.sae gravatar imagethitapa.sae ( 2019-07-18 21:52:12 -0500 )edit
0

answered 2019-05-28 01:56:21 -0500

KrishKannan_007 gravatar image

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 :).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-05-23 04:03:47 -0500

Seen: 80 times

Last updated: May 28