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

Revision history [back]

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.