-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
mppi parameters_handler: Improve verbose handling (#4704) #4711
base: main
Are you sure you want to change the base?
mppi parameters_handler: Improve verbose handling (#4704) #4711
Conversation
The "verbose" parameter of the parameters_handler is a special case that needs registration before the dynamic parameter handler callback is registered. In verbose mode make the parameter handler info/warn/debug messages more expressive. Signed-off-by: Mike Wake <[email protected]>
baae2fd
to
7e9304b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
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.
Generally approve, 2 nits and will merge!
nav2_mppi_controller/include/nav2_mppi_controller/tools/parameters_handler.hpp
Outdated
Show resolved
Hide resolved
* remove comments. * Use RCLCPP_DEBUG instead of INFO for low level messages. * Add test for trying to access parameters that are not declared. Signed-off-by: Mike Wake <[email protected]>
…os-navigation#4704) Attempts to change undefined parameters will not be successful and will log an error. Attempts to change static parameters will be ignored, a debug message is logged if a change in parameters is attempted. Signed-off-by: Mike Wake <[email protected]>
b8d38c7
to
4cf6d2b
Compare
setting = as<T>(param); | ||
|
||
if (verbose_) { | ||
RCLCPP_INFO(logger_, "Dynamic parameter changed: %s", std::to_string(param).c_str()); | ||
} | ||
}; | ||
|
||
addDynamicParamCallback(name, callback); | ||
auto static_callback = [this, &setting, name](const rclcpp::Parameter & param) { |
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.
If a static callback is created, then if someone attempts to set a static parameter through the dynamic parameter interface, it would return true
on the change, even though its static and rejected the update. I would think that it should fail to find the callback and thus return false
, just as if the parameter doesn't exist since this parameter is not able to be adjusted dynamically
I see that it logs, which is good, but I think the dynamic parameter setting application needs to get a failure code that it indeed did not successfully set the new parameter's value
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.
@aosmw following up on this item
The "verbose" parameter of the parameters_handler is a special case that needs registration before the
dynamic parameter handler callback is registered.
In verbose mode make the parameter handler info/warn/debug messages more expressive.
Basic Info
Description of contribution in a few bullet points
Improve the verbose handling of the mppi parameter_handler class and make it more verbose to
help distinguish between ParameterType::Dynamic and ParameterType::Static parameters.
Description of documentation updates required from your changes
Key point is to treat the verbose parameter of the mppi parameter_handler class
as a special case and register it BEFORE the dynamic parameter handler callback is
registered.
Other parameters may be "ParameterType::Static" on purpose, so a decision is required
about whether or not to return false from the dynamicParamsCallback is required.
I left it as false as per initial PR.
Future work that may be required in bullet points
Make decision about returning false and remove commented out return true.
For Maintainers: