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

how to launch program out-side ros package from launch file

asked 2011-06-09 16:26:43 -0500

chen gravatar image

Are there any way to start a program in /usr/local/bin from launch file?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-06-09 19:03:35 -0500

Lorenz gravatar image

I don't think there is a direct way to achieve this. But you could easily write a wrapper script and put it into a ros package. The script could look like this:

exec $1 ${@:2}

A corresponding launch entry, assuming that the script is called and lies in package mypackage, would look like this:

<node name="shell_cmd" type="" pkg="mypackage"
      args="/bin/echo foo" />

Please note that roslaunch will pass an additional parameter that sets the name for nodes and if necessary topic remappings. The output of the above command should be something like

foo __name:=shell_cmd

You might need to extend the wrapper script to get rid of those additional parameters.

edit flag offensive delete link more


That would be one solution, does anybody knows another one? for instance, hidden tag in roslaunch?
Kei Okada gravatar image Kei Okada  ( 2011-06-10 04:49:48 -0500 )edit

answered 2011-06-10 05:02:11 -0500

Hi, you can make sure an executable is found via the ros package mechanism by creating links to the programs you need in a ros package.

Maybe you can also use ROS_LOCATIONS

edit flag offensive delete link more

Question Tools


Asked: 2011-06-09 16:26:43 -0500

Seen: 434 times

Last updated: Jun 10 '11