Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to execute the rest of the python script while launching and running the launch files in the background?

I want to launch multiple launch files inside a python script. I'm planning to use the os.system("roslaunch ...") command from os library.

Since I have multiple launch files, it will look something like this:

os.system("roslaunch 1 & roslaunch 2 & roslaunch 3") command,

but these commands show output of the nodes in roslaunch on the terminal and the python code isn't executed further until these nodes are terminated, which I don't want. I want to execute the command and launch the nodes, keep these roslaunch files running and want to get back to the rest of the code loop while the processes still run.

How can I do that?