Wait until nodes launched from code are ready
Hi all,
My question is quite simple. I have a node that launches other nodes using process API. I can not use rosspawn, since I need to launch them with arguments. After that, my node has to wait until the created nodes have started to be sure that they are ready. Nowadays, I basically have one function that checks the nodes against 'roslist' and my node is blocked there until all of them are ready. I am guessing, is there any better way to do this?
I do not understand why
roslaunch
is not suitable here, can you be more precisse of what is your set up/requirements?Thanks for your comment. I use roslaunch. My problem is that the node that actually calls roslaunch to launch other nodes, it has to wait some time until they are ready. I am guessing which is the best way to do that.
I mean if you use
roslaunch
you do not need to call the launch file from any node, You just generate a launch file including the other launch files in the order you want and each launch file will be launched in that order. If you want to wait between launch files you can implement a bash script in which you callroslaunch your_package your_file.launch
and then exucutes asleep X
between commands.Ok, I get your point. I was guessing precisely if I can avoid sleeps, but sleeps in a bash file are much better than in the middle of the code, so it is an important improvement. Thanks!