Rospy launch multiple file.launch from python node
Hi everyone.
I would like to know if there are libraries or functions for launch one or more file.launch from a python node without waiting the end of the first node to launch the second. Specifically, my python node will be a simple subscriber that will read the node name to launch from a specific message:
import rospy
from std_msgs.msg import node_name
def node_launch(data):
node = data.data
---------------
def listener():
rospy.init_node('node_name')
rospy.Subscriber("chatter", String, node_launch)
rospy.spin()
I would like to know how to implement the logic to launch a node inside the def node_launch (data): without it waiting for the end of the node and being able to launch another node if required. Are there any procedures or libraries to do this or do I have to create with differents threads?
Thanks everyone.
If you type
python subprocess
into the search box at the top of this page, you get more than 100 hits.