Launch File
Last updated
Last updated
Launch files are used to launch a large system with many executables where an executable may contain multiple nodes. From a computing perspective, nodes or executables form a graph because the philosophy of ROS2 is to have independent modules that focus on a single responsibility. The communication between nodes are supported through message passing. From a launch process perspective, the executables and launch files form a tree structure.
Suppose we have a main launch file for our project learn-launch-file
. This launch file can launch nodes/executables of the project learn-launch-file and run launch files in other projects. A more concrete example is presented below:
The syntax are different for these two types of tasks. To launch a node, we use the Node
class. For example:
To run another launch file inside our current launch file, we use IncludeLaunchDescription
and PythonLaunchDescriptionSource
. For example:
The parameters for specifying the arguments are different. Use arguments for a node and launch_arguments for a launch file.