ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I also stumbled across this problem and implemented a generic solution. You might want to have a look at the aliencontrol ROS package.
This package contains a node that starts any external application. Almost more importantly, the node also takes care of a clean shutdown, no matter whether the external application or the containing ROS node is terminated.
It is run like so (if you wanted to start your_script.sh
):
rosrun aliencontrol aliencontrol /path/to/your_script.sh
If you want to embed it in your launch script, add:
<node pkg="aliencontrol" type="aliencontrol" name="aliencontrol">
<param name="cmd" value="/path/to/your_script.sh"/>
</node>