Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds
Node::create_parameter()and a booleanallow_undeclared_parametersto the node's constructor. Parameters may be given a type, a default value, and a bool indicating whether or not they're read only. Read only parameters are initialized, but may not be changed after initialization.The features work except for a test failure in
test_time_source.cpp, and I have no idea why. The failure symptom is theon_parameter_eventcallback inTimeSourcedoes not get called.The time_source test passes if I step through the problem area in GDB. That is, I set a breakpoint at the start of the failing test then set a break point inside
TimeSource::on_parameter_event. If I hit 'c' for continue the test fails and the breakpoint is not reached. If I instead hitnrepeatedly then the breakpoint is reached in thespin()call and the test passes.There are a couple missing features. Since this PR adds the concept of declaring parameters, it should be possible for a node to error if a run-time user tries to set an undeclared parameter. This could be done with a method that throws if any undeclared parameters where provided, but a node-author would be responsible for calling this method after all parameters have been declared.
Other nodes may allow undeclared parameters (like the observation source parameters in obstacle layer in costmap 2d). If they pass
allow_undeclared_parameters = trueto the constructor then the initial parameters provided by a run-time user are immediately set on a node. A future enhancement could let a node say parameters starting withfoo.bar.may be undeclared.requires #488