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

Revision history [back]

I don't think so.

Roslaunch is what is used to launch multiple nodes. There was a package called roslaunch_caller to launch nodes programatically but it is not supported and its recommended not to use.

perhaps a reevaluation of your requirements is in order as it would be much simpler to pass information within a process using traditional programming concepts, rather than using publishers and subscribers via TCP.

I don't think so.

Roslaunch is what is used to launch multiple nodes. There was a package called roslaunch_caller to launch nodes programatically but it is not supported and its recommended not to use.

perhaps a reevaluation of your requirements is in order as it would be much simpler to pass information within a process using traditional programming concepts, rather than using publishers and subscribers via TCP.

Update

You can run launch files from python using a cmd line package such as subprocess. To change your launch environment you can add arguments to your launch file which can be used as parameters that can be accessed by nodes, and specified by the script.

e.g.

ret = sp.call('roslaunch pkg_name launchfile_name.launch arg1:="{}" arg2:={} arg3:="{} {} {} {}" arg4:="{}"'.format(param1, param2, param3, param4, param5, param6, param7), shell=True)

using shell=True is required to import the ROS_WORKSPACE setup, but as noted in the subprocess documentation it can be a security hazard.