Running your first node
To understand what a node is, we will simply run one and make some observations using some of the most useful ROS 2 tools.
For this chapter, I recommend having a few open terminals. You can start a few terminal windows and arrange them on your screen or run Terminator (see Extra tools for ROS development in Chapter 2) with at least three tabs. To clear any confusion when running a command, I will also tell you in which terminal to run the command (Terminal 1, Terminal 2, etc.).
Starting a node from the terminal with ros2 run
Let’s discover your first ROS 2 tool, and probably the most important one: the ros2
command-line tool. You will use this tool all the time in your future projects.
ros2
comes with a lot of functions. We will explore some of them in this chapter, and more in the following ones. There is no need to remember all the commands: just use them to build an understanding now, and later you will easily be able to retrieve them from...