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

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

Comments

I opened up a new similar thread w/o knowing this conversation was taking place half an year ago...anyways FYI: http://answers.ros.org/question/3225/terminate-launch-other-node-from-code 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
3

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

Ugo gravatar image

I used roslaunch.scriptapi a while ago and it was doing its job: http://www.ros.org/doc/api/roslaunch/html/roslaunch.scriptapi.ROSLaunch-class.html

You could also use the default python subprocess.

edit flag offensive delete link more

Comments

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

Stats

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

Seen: 2,851 times

Last updated: Mar 22 '11