About This Chapter

This chapter provides the detailed explanation of ROS 2 Control, including how the controller configuration, ros2_control interfaces, Gazebo integration, and wheel joints work together. The practical implementation of these concepts is covered in Chapter 28.

Go to Chapter 28
Bumperbot, chapter 25: ros2_control in Gazebo

Making the robot drivable, one file at a time

Until now the Bumperbot could be seen and simulated, but nothing could turn its wheels. This chapter adds ros2_control. The new code is small. The hard part is that the files point at each other, so this page builds the picture one step at a time, in the order the work is done.

Each step shows one file, explains every line of it, and only then shows how it connects to the files already seen. Every connection can be clicked to see the two lines side by side.

Explained in chapter 25The chapter this page belongs to has the full walkthrough.Click here to visit chapter 25
01

What changed in this chapter

One new package, one new xacro file, and four existing files with a few added lines. The links and joints of the URDF, and all the physics settings, are untouched.

1new package
2new files
4changed files
0links or joints changed
02

Step by step

Thirteen steps, in the order the work is done. Each one starts with where things stand, shows one piece of code with every line explained, shows how it connects to what came before, and ends with a small lab to play with.

03

Everything connected

Now that every file has been met, here is the whole picture. Pick a connection to see the files it joins, the lines involved, and the rule they have to obey.

the ten rules that hold it together
04

Break it on purpose

Each scenario changes one thing in one file. The page shows what else had to agree with it, and what the startup log would look like. Messages vary between versions, so the symptoms are described as typical.

05

Quiz

Next chapter. The robot can now be driven by ros2_control, but nothing sends it a command yet. Starting the two controllers and moving the Bumperbot is the next chapter. This chapter is explained in chapter 25: click here to visit it.