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

Revision history [back]

click to hide/show revision 1
initial version

I think this is the ROS way to do it:

import roslaunch
uuid = roslaunch.rlutil.get_or_generate_uuid(options_runid=None, options_wait_for_master=False)
roslaunch.configure_logging(uuid)
launch = roslaunch.parent.ROSLaunchParent(uuid, roslaunch_files=[], is_core=True)
launch.start()
#  --- your code ---
launch.shutdown()

You can specify your launch files as a list of string in the ROSLaunchParent constructor. Check the doc if needed.