Updating parameters with parameter callbacks
After a parameter’s value has been set when the node starts, you can modify it from the terminal or with a service client. To be able to receive the new value in your code, however, you will need to add what is called a parameter callback.
In this section, you will learn how to implement a parameter callback for Python and C++. This callback will be triggered whenever a parameter’s value has been changed, and we will be able to get the new value in the code.
Note
You don’t necessarily need to add parameter callbacks in your nodes. For some parameters, you will want to have a fixed value when you start the node and not modify this value anymore. Use parameter callbacks only if it makes sense to modify some parameters during the execution of a node.
Parameter callbacks are a great way to change a setting in your node without having to create yet another service. Let me explain that with the camera driver example...