In a career as a robotics software developer, almost every robot will use the ros2_control library in some way. It solves a fundamental problem in robotics, and it does so in a modular and flexible manner.
This is possible thanks to the configurability and flexibility of the library. It can be configured in many different ways to meet the requirements and the needs of each robot, no matter how different and unique it is. Every one of those ways of configuring it comes down to parameters.
In the previous section the parameters of a ROS 2 node were set one value at a time: through the command line interface, and through the launch files. With many configurable parameters, a simpler and more user friendly way is needed to set all of them, and to get an overview of the value chosen for each one. That is where YAML configuration files come in handy.
The parameter names here are placeholders, only to count commands.
With the YAML format, variables, objects, vectors and so on can be represented in a human readable way. This makes the value of each parameter easy to modify, and gives a quick and complete overview of the configuration parameters in use.
A configuration file for a node starts with the name of the node itself. Then the ros__parameters tag indicates that this node is going to be configured: the parameters it offers are about to be set. Then come the actual node parameters, each one made of a name as declared by the node, and the value to assign to it.
Parameter names and values here are placeholders. The structure is the real one.
With a YAML file, all the parameters are set in one go with a single command, so that they are available to the node at runtime. This uses the file built in section 04: change it there or here.
The stale value shown after an edit is a demo detail: the node holds what was loaded until the file is loaded again.