Launch Files
Overview¶
As you should know from the COM2009 ROS Course, Nodes can be executed on a ROS network in two ways:
-
Using the
rosruncommand: -
Or by using
roslaunch:
In Assignment #1 Part 1 you learn that a launch file is an xml file with a .launch file extension. Inside this we can ask ROS to do a number of different things from one single roslaunch command-line call.
roslaunch offers a number of advantages over rosrun:
- Multiple nodes can be executed simultaneously.
roslaunchwill launch the ROS Master for us, if isn't already running (so we don't have to manually callroscore).- From within one
.launchfile, we can launch other.launchfiles. - We can pass in additional arguments to launch certain things conditionally, or pass specific arguments to certain ROS nodes.
- As if that wasn't enough, there is also a
roslaunchPython API, allowing us to launch nodes from within other (Python) nodes!
In this section we'll talk about some of these advanced features that you may find useful.