What is a ROS 2 launch file?
After everything you’ve learned already, understanding the concept of launch files will not be very difficult.
You have experimented a bit with launch files in Chapter 3. We will now, as usual, start from scratch and see what a launch file is with an example. First, we’ll look at why we need launch files.
Why launch files?
As your ROS 2 application starts to grow, so does the number of nodes and parameters. For example, a ROS stack I developed for a robotic arm had more than 15 nodes and 200 parameters. Imagine opening 15 terminals and starting all the nodes one by one with all the correct values for parameters. This would quickly become a nightmare.
For this explanation, let’s assume we have the following nodes in our application:
- Three camera nodes with different settings
- Two LED panel nodes with varying numbers of LEDs
- One battery node
- Another node with more parameters
Here is what your application...