Skip to content

Parameter callback corrections #54

@JMoore5353

Description

@JMoore5353

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions