Back to the 2026 paper

Module 2: Basics of Robot Operating System (ROS)

20267m

Explain the importance of ROS Launch Files.

Worked SolutionAI Assisted

Importance of ROS Launch Files

A launch file is an XML file (.launch) that starts many nodes, sets parameters and includes other launch files with a single command:

roslaunch demo_pkg demo.launch

Without it, you would open a separate terminal and run rosrun for every node, and also start roscore manually.

Example (demo.launch)

<launch>
  <arg name="rate" default="10"/>
  <param name="/loop_rate" value="$(arg rate)"/>
  <node pkg="demo_pkg" type="talker.py" name="talker" output="screen"/>
  <node pkg="demo_pkg" type="listener.py" name="listener" output="screen"/>
  <include file="$(find demo_pkg)/launch/sensors.launch"/>
</launch>
Tag Use
<node> Start a node (pkg, type, name, output)
<param> Set a parameter on the Parameter Server
<arg> Pass an argument at launch time
<include> Reuse another launch file
<remap> Rename a topic
MermaidDiagram
Rendering diagram…

Importance

  1. Starts the whole robot system with one command.
  2. Automatically starts roscore if needed.
  3. Sets parameters and remaps topic names without changing code.
  4. Reusable configurations via include and arg.
  5. Can restart (respawn) crashed nodes and launch nodes on other machines.

Exam tip

Always give the small XML example with <node>, <param> and the roslaunch command.

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.