Ask Your Question
0

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

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

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
0

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

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:

#!/bin/bash
exec $1 ${@:2}

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

<node name="shell_cmd" type="launch_system_cmd.sh" 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

Comments

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 -0600 )edit
0

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

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

Your Answer

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

Add Answer

Question Tools

Stats

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

Seen: 205 times

Last updated: Jun 10 '11