O'Reilly logo

Robot Operating System Cookbook by Kumar Bipin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding the ROS launch file

In previous sections, we created nodes and have been executing them in different shells. Imagine working with 20 nodes and the nightmare of executing each one in a shell! However, with the launch file, we can do it in the same shell by launching a configuration file with the extension .launch. The launch file is a useful feature in ROS for launching more than one node.

To learn about the ROS launch file, we will create a new folder in the chapter2_tutorials package, as follows:

$ roscd chapter2_tutorials/ 
$ mkdir launch 
$ cd launch 
$ vim chapter2.launch 

Add the following code inside the chapter2.launch file:

<?xml version="1.0"?> <launch> <node name ="example1a" pkg="chapter2_tutorials" type="example1a" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required