ROS Launch Files — Running Your System Like a Real Application

1. Objective — What You Are Building and Why

In this final lesson, you will learn how to use ROS launch files to run your entire application in a clean and scalable way.

Up to now, you have been starting nodes manually:

  • one terminal → roscore
  • one terminal → turtlesim_node
  • one terminal → controller
  • one terminal → service

This works, but it quickly becomes:

  • slow
  • error-prone
  • hard to manage

👉 A launch file solves this.

With a launch file, you can:

start your entire ROS system with one command

2. Code Explanation — What / How / Why

Step 1 — What Is a Launch File?

A launch file is an XML file that allows you to:

  • start multiple nodes
  • set parameters
  • configure your system

Think of it as:

👉 the entry point of your robotic application

Step 2 — Example Launch File

Here is your launch file:

<launch>    
  <param name="/threshold_parameter" type="double" value="0.05" />    
  <node name="turtlesim" pkg="turtlesim" type="turtlesim_node" />    
   <node name="control_rumba_robot" pkg="rumba_pathway" type="rumba_controller" />    
   <node name="service_go_to_position" pkg="rumba_pathway" type="go_to_position_server" />

</launch>
        


Step 3 — Understanding Each Part

Parameters

<param name="/threshold_parameter" type="double" value="0.05" />

This sets a parameter on the ROS parameter server.

So instead of doing:

rosparam set /threshold_parameter 0.05

you define it directly in the launch file.

This is much cleaner and reproducible.

Nodes

Turtlesim node

<node name="turtlesim" pkg="turtlesim" type="turtlesim_node" />

This launches the simulator.

Controller node

<node name="control_rumba_robot" pkg="rumba_pathway" type="rumba_controller" />

This is your main logic:

  • subscribes to pose
  • publishes velocity
  • calls services
  • uses parameters

Service node

<node name="service_go_to_position" pkg="rumba_pathway" type="go_to_position_server" />

This node provides the custom service:

/go_to_position

It processes target requests and returns motion information.

Step 4 — Why Launch Files Are Powerful

Instead of running 3 terminals:

rosrun turtlesim turtlesim_node


rosrun rumba_pathway rumba_controller

rosrun rumba_pathway go_to_position_server

You can simply run:

roslaunch rumba_pathway your_launch_file.launch

One command → full system running

Step 5 — Real-World Insight

This is where things get very interesting.

In real robotics projects, you often:

  • clone a repository
  • build the workspace
  • and run the system

And very often:

👉 you don’t touch the code

You only modify the

launch file.

Why?

Because good ROS nodes are designed to:

  • expose parameters
  • be configurable externally

So instead of changing code, you just adjust:

  • parameters
  • node names
  • topic remapping

inside the launch file.

That is how professional ROS systems are structured.

Step 6 — Important Design Principle

For this to work properly:

👉 your nodes must be written to use parameters

Like you did with:

n_.getParam("/threshold_parameter", threshold);

This is the key idea:

  • code = logic
  • launch file = configuration

If you design your nodes like this, your system becomes:

  • reusable
  • scalable
  • easy to maintain

3. Demo

In the video, you will:

  1. Create the launch file
  2. Add nodes and parameters
  3. Run the system with one command
  4. Observe the full Rumba behavior in Turtlesim

This is the moment where everything comes together:

  • simulation
  • controller
  • service
  • parameters

all running as one system.

4. Key Takeaways

After this final lesson, you now understand how to run a complete ROS application.

✅ Launch files start your entire system

One command replaces multiple terminals.

✅ Parameters belong in launch files

They make your system configurable and clean.

✅ Good ROS design separates logic and configuration

  • nodes = behavior
  • launch file = setup

✅ You can adapt applications without changing code

Often, modifying the launch file is enough.

🎯 Final Message — What You Achieved

You just completed the ROS1 Foundations module.

Take a moment to realize what you can do now.

You learned how to:

  • create ROS workspaces and packages
  • write nodes in C++ and Python
  • use publishers and subscribers
  • understand and inspect topics
  • build service servers and clients
  • create custom messages and services
  • use parameters to configure behavior
  • structure a full robotic application
  • launch everything in a clean and scalable way

But more importantly:

👉 you did not just learn concepts
👉 you built a working system

You took a simulator and turned it into a small autonomous robot behavior.

That means you can now:

  • understand ROS-based projects
  • debug them
  • modify them
  • and start building your own

This is real, practical value.

You are no longer at the “what is ROS?” stage.

You are at the stage where you can:

build, run, and reason about robotic systems.

🚀 Next step?

Now that the foundations are solid, you are ready to move toward:

  • more complex architectures
  • simulation environments
  • real robot integration

But everything starts from here.

And you now have those foundations.

Complete and Continue