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

roslaunch external program

asked 2013-02-07 03:57:57 -0500

natekoenig gravatar image

Is it possible to run a non-ros program from a roslaunch file? For example, I would like to run the system installed version of Gazebo.

I looked in the roslaunch documentation, and couldn't find a solution.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
2

answered 2013-02-07 04:37:01 -0500

dornhege gravatar image

AFAIK it's not possible. Depending on how much you need it, you could create a ROS package with one bash script sytem_run.sh or similar, that just runs whatever binary + args is passed as params.

edit flag offensive delete link more
2

answered 2013-02-07 04:36:38 -0500

dbworth gravatar image

updated 2013-02-07 04:42:23 -0500

Nate, the suggested method was to wrap a system call.

See this node:
http://www.ros.org/wiki/webots_run
for an example of running an executable from a ROS package.

Two useful behaviours are:
1. This node launches with required="true" and the source code doesn't ros::spin. The result is that if you launched everything from one launch file, when you close the simulator, it will drop back to console. (this is good once the system is complete)
2. Alternatively, you can start roscore in 1 terminal, this node to launch the simulator in a 2nd terminal, then in the 3rd terminal you can keep re-launching your controller nodes while you debug them, without taking down the simulator front-end each time.

Refs:
http://answers.ros.org/question/33772/run-shell-command-from-launch-script/
http://answers.ros.org/question/51474/can-i-run-a-bash-script-using-roslaunch/


p.s. Any idea how long before ROS Fuerte users will be able to seamlessly swap to Gazebo stand-alone? ;-) (eg. if currently using the PR2 Controller Manager joint controllers)

edit flag offensive delete link more
0

answered 2018-10-24 17:25:50 -0500

aschaefer gravatar image

You could use the aliencontrol ROS package.

This package contains a node that starts the 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 top):

rosrun aliencontrol aliencontrol top

If you want to embed it in your launch script, add:

<node pkg="aliencontrol" type="aliencontrol" name="aliencontrol_top">
    <param name="cmd" value="top"/>
</node>
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2013-02-07 03:57:57 -0500

Seen: 3,209 times

Last updated: Feb 07 '13