A .launch file in ROS 1 is an XML file that automates the process of starting and configuring multiple ROS nodes, parameters, and other system components from a single command. Instead of manually launching each node and setting parameters in separate terminals, you can use a launch file to start everything at once, in the correct order and with the desired configuration1246.
<launch> (the root), <node> (to start a node), <param> (to set parameters), and others34.`xml<launch> <!-- Start a node --> <node pkg="turtlesim" type="turtlesim_node" name="sim"/>
*<!-- Set a parameter -->*
<param name="background_r" value="255"/>
*<!-- Start another node -->*
<node pkg="turtlesim" type="turtle_teleop_key" name="teleop"/>
</launch>`
Place launch files in a launch directory within your package.
Run with:
bashroslaunch <package> <file.launch>
roslaunch will also automatically start the ROS master (roscore) if it's not already running46.
| Feature | Description |
|---|---|
| File extension | .launch |
| Format | XML |
| Main purpose | Start/configure multiple nodes and parameters at once |
| How to run | roslaunch <package> <file.launch> |
| Example tags | <launch>, <node>, <param>, <arg>, <group>, <include> |
| Key benefit | Simplifies and automates complex ROS application startup |
In summary:
A .launch file in ROS 1 is a powerful XML configuration file that lets you start and manage multiple nodes and parameters with a single command, making large-scale robotics development much more efficient1246.