0
$\begingroup$

Rosanswers logo

I have a launch file, with following:

 <!-- Launch Gazebo -->   
 <include file="$(find turtlebot_gazebo)/launch/turtlebot_world.launch"> </include>
 <!-- Launch AMCL -->  
 <include file="$(find my_package)/launch/my_amcl.launch">    </include>
 <!-- Launch Move base -->  
 <!-- Launch Rviz -->  

Inside this launch file I want to also run a python script navigate.py located in my_package/scripts. I have try <include file="$(find my_package)/scripts/navigate.py"> </include> but it doesn't works. Is there a way to do that?


Originally posted by kiko453 on ROS Answers with karma: 17 on 2019-12-14

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

This has been asked and answered before: https://answers.ros.org/question/229841/how-launch-a-python-script-with-roslaunch/


Originally posted by fexner with karma: 221 on 2019-12-14

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by kiko453 on 2019-12-14:
this is not the same. I tried that, but didn't work. SO I've tried

  <node pkg="my_package" name="navigate.py" type="navigate.py" output="screen"> 
  </node>

but it didn't work

Comment by fexner on 2019-12-16:
Did you make your script executable? navigate.py has to be an executable script. See the example python node for details

Comment by kiko453 on 2020-01-24:
working now, thanks.

$\endgroup$

Your Answer

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