-
Notifications
You must be signed in to change notification settings - Fork 12
Description
We currently use the add_on_set_parameter_callback API to create a parameter callback to update the values stored in the param_manager when ROS2 parameters are changed.
However, according to the ROS2 docs regarding parameter changes, it seems that a on_parameter_event callback would be better. This is because our callbacks definitely have side effects, and therefore run the risk of desyncing the internal stored parameters with the ROS2 parameters. This would happen if a callback rejected the update.
I think our code works as intended now because we usually only change one parameter at a time (since launch files don't trigger the callback created with the add_on_set_parameters call). Furthermore, our code only rejects changes when a parameter doesn't exist. We also don't currently chain callbacks, so there is no risk of a future parameter callback called down the line rejecting the parameter change already accepted by the callback up the line.
Despite this, however, it would probably be better to implement the on_set_parameter callback to avoid potential issues.
@iandareid @bsutherland333 Is this how you understand the ROS2 documentation about parameter callbacks as well?