How can one run a node from inside another node's code. I mean I want to run a node when a specific condition is true, and then shutdown it. normally we run a node from terminal using "rosrun pakg node" but how to run this node in c/python code?
thanks in advance.
I don't know if I'm in time to help, but I'll still try!
The only way of doing it that comes to mind right now is using the system call from C (I guess there must be a similar function in python too, sorry I'm not much of a python guy as of now :p)
So I think you can do what you say with something like:
if(condition) system("rosrun package node");
Then the node itself should do the work it has to do, then finish. From your message I don't know if what you want is that the program that ran the system call should also be the one that kills that new node.
As for a particular ROS function that runs a node itself, I've been looking for one too but I can't seem to find it. If there's one I would very much like to hear from it :D
thanks for the reply...in ROS what I know is that to invoke the nodes use action servers. Make one action client which can call action servers one by one to invoke node's functionality. http://www.ros.org/wiki/actionlib_tutorials/Tutorials provides help how to make actions.
On 06.02.2011 21:41, safdar_zaman wrote:
> Hi all,
> How can one run a node from inside another node's code. I mean I want to run
> a node when a specific condition is true, and then shutdown it. normally we
> run a node from terminal using "rosrun pakg node" but how to run this node
> in c/python code?
> thanks in advance.