-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add Node API method for setting the parameters_callback. #228
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with one inline question
Is there CI for this PR ?
self.node.destroy_node() | ||
|
||
def test_set_callback_accepting_all(self): | ||
global callback_called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it necessary for this to be global? could it be local to each test case and nonlocal to the callbacks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL about nonlocal
That's precisely what I needed. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved by 73f6cf2
In #214 I wired up support for invoking a callback function to accept or reject a set of parameters but did not add the API to set that callback or tests for that functionality.
This pull request adds a
set_parameters_callback
method to rclpy.Node and some unit tests verifying that the callbacks are used and that the parameter values are set or not appropriately.Every test case I used has been put into the unit tests below.
Connects to #202