Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the set_parameters_callback example program. #608

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

clalancette
Copy link
Contributor

In particular, the 'on_set_parameter_callback' callback was checking for undeclared parameters, but that could not have been a problem since 'allow_undeclared_parameters' is set to false by default.

Instead, change the logic in that callback to arbitrarily reject parameters > 5.0 (for param1) or < -5.0 (for param2). That is a much better demonstration of what this node should do.

Also add in a print during the constructor, telling the user what to expect.

In particular, the 'on_set_parameter_callback' callback
was checking for undeclared parameters, but that could
not have been a problem since 'allow_undeclared_parameters'
is set to false by default.

Instead, change the logic in that callback to arbitrarily
reject parameters > 5.0 (for param1) or < -5.0 (for param2).
That is a much better demonstration of what this node should do.

Also add in a print during the constructor, telling the user what
to expect.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette
Copy link
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette clalancette merged commit bea485e into rolling Mar 27, 2023
@clalancette clalancette deleted the clalancette/fix-set-parameters-callback branch March 27, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants