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

roslaunch external program

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

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

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

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 or similar, that just runs whatever binary + args is passed as params.

edit flag offensive delete link more

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

dbworth gravatar image

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

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

See this node:
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.


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

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

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"/>
edit flag offensive delete link more

Question Tools



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

Seen: 3,167 times

Last updated: Feb 07 '13