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

roslaunch python

asked 2014-07-14 08:12:22 -0600

Maya gravatar image


I'm trying to write a launch file for my python program. My program is named and is located in searching_tobot/src. Here is my launch file so far :


<group ns="robot0">
<node name="search" pkg="searching_tobot" type="search" output="screen">

<group ns="robot1">
<node name="search" pkg="searching_tobot" type="search" output="screen">


However I have this error :

core service [/rosout] found
ERROR: cannot launch node of type [searching_tobot/search]: can't locate node [search] in package [searching_tobot]
ERROR: cannot launch node of type [searching_tobot/search]: can't locate node [search] in package [searching_tobot]

And I can't find what I'm doing wrong. I tried replacing search by with no luck

I'm used to do launch file with C++ executable and I'm a bit of a newbie with python on ROS and I couldn't find the answer and the wiki :S. Thanks a lot !

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-07-14 09:03:26 -0600

Wolf gravatar image

I am not sure if who have to use search or (I believe the latter or both work) but one should work. My guess is your script file is not executable. Go to your searching_tobot/src and run

chmod +x
edit flag offensive delete link more



You need to use whatever the file is called, so probably

dornhege gravatar image dornhege  ( 2014-07-14 09:39:25 -0600 )edit

i tried this and it works, what is the reason behind this ?

marawy_alsakaf gravatar image marawy_alsakaf  ( 2017-11-02 04:47:05 -0600 )edit

answered 2016-01-25 04:30:27 -0600

donmrsir gravatar image

updated 2016-01-25 04:31:52 -0600

Also i don't know if this was your problem. But when you launch a node, the type parameter is the name of the executable to launch. Therefore since python does not need a compiler, and the executable is the own .py file. You need to just specify the .py file. This means something like this.

<node name="search" pkg="searching_tobot" type="" output="screen">

I had a similar problem and this worked for me.

Hope this helps to anyone!

edit flag offensive delete link more


Isn't this exactly what @Wolf answered (and @dornhege clarified)?

gvdhoorn gravatar image gvdhoorn  ( 2016-01-25 06:07:39 -0600 )edit

Oh yes! sorry, I thought they refer to the sintaxis in the chmod call. Didnt read it carefully, my fault. Thank you for the note

donmrsir gravatar image donmrsir  ( 2016-01-26 02:56:47 -0600 )edit

No problem, don't worry. I was just wondering whether there was something in addition to what the other answer already provided.

gvdhoorn gravatar image gvdhoorn  ( 2016-01-26 03:32:04 -0600 )edit

Question Tools

1 follower


Asked: 2014-07-14 08:12:22 -0600

Seen: 12,621 times

Last updated: Jan 25 '16