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

Spawn and kill nodes from nodes/smach

asked 2011-03-22 22:41:28 -0500

Miguel Prada gravatar image

updated 2011-03-22 22:41:43 -0500

I'm looking for a way to spawn/kill nodes from other running nodes or from smach SMs.

The roslaunch page makes it very clear that the roslaunch API is very unstable, which makes me afraid to use it. I've also found rosspawn tool, but its implementation is reportedly in proof-of-concept state and I see that the commits to it's repository stopped in October 2010.

Is there any recommended way to do this? Is using nodelets instead of regular nodes the best option?

edit retag flag offensive close merge delete


I opened up a new similar thread w/o knowing this conversation was taking place half an year ago...anyways FYI: some new ideas there
130s gravatar image 130s  ( 2011-12-08 05:14:26 -0500 )edit
Great, thanks for the information!
Miguel Prada gravatar image Miguel Prada  ( 2011-12-12 19:40:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-03-22 23:01:51 -0500

Ugo gravatar image

I used roslaunch.scriptapi a while ago and it was doing its job:

You could also use the default python subprocess.

edit flag offensive delete link more


Ok, I think I'll give it a try. Just to be sure I'm using it properly, is this correct? Create a Node instance -> create a ROSLaunch instance -> start the ROSLaunch instance -> launch the Node instance using ROSLaunch.launch and save the Process returned -> wait -> kill the node using Process.stop()
Miguel Prada gravatar image Miguel Prada  ( 2011-03-23 21:38:18 -0500 )edit

Question Tools

1 follower


Asked: 2011-03-22 22:41:28 -0500

Seen: 2,816 times

Last updated: Mar 22 '11