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

How to dynamically launch and kill nodes?

asked 2018-03-13 08:31:32 -0500

Cerin gravatar image

Is there any best practice and/or guides surrounding how to dynamically launch and kill nodes?

I'm building a small Raspberry Pi based robot, and since it only has 1GB of memory and limited CPU, I don't want every possibly node I use to be loaded, because even a node that's "standing by" consumes about 2-3% of memory.

For example, say I want to start a procedure that looks for QR codes in a video stream. If I don't normally do this, it doesn't make sense to have a QR tracking node running at all times, so I'll want to dynamically launch the node as needed, and then kill it when the procedure is complete. What's the best way to do this using rospy?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-13 08:45:40 -0500

tuandl gravatar image

updated 2018-03-13 09:45:20 -0500

For killing a node when you finish processing: #q250494

For starting a node only when it is required, I would suggest using actionlib.

edit flag offensive delete link more


Cerin gravatar image Cerin  ( 2018-03-13 09:42:54 -0500 )edit

Sorry, edited the link.

tuandl gravatar image tuandl  ( 2018-03-13 09:45:39 -0500 )edit

Question Tools



Asked: 2018-03-13 08:31:32 -0500

Seen: 609 times

Last updated: Mar 13 '18