You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My goal is to be able to provide the infrastructure for a parameter library without requiring actual parameters. This could be because I'm stubbing out a class early in development or if I am just wanting to be consistent and provide an easy place for future work to add to.
Something like:
foo::bar_params: []
I would expect then that accessing the params with get_params() returns an empty list:
param_listener_ = std::make_shared<bar_params::ParamListener>(get_node());
params_ = param_listener_->get_params();
// params _is an empty list
The current workaround is to provide a dummy value:
foo::bar_params:
dummy:
type: int
but this just leads to cruft that I'd rather not have.
I tried to use the none type to not actually generate the dummy param, but this doesn't compile in C++ due to an unused-variable warning.
foo::bar_params:
dummy:
type: none
bar_params.hpp: In member function‘rcl_interfaces::msg::SetParametersResult foo::bar_params::ParamListener::update(const std::vector<rclcpp::Parameter>&)’:
bar_params.hpp:135:24: error: unused variable ‘param’ [-Werror=unused-variable]
135 |for (const auto ¶m: parameters) {
The text was updated successfully, but these errors were encountered:
My goal is to be able to provide the infrastructure for a parameter library without requiring actual parameters. This could be because I'm stubbing out a class early in development or if I am just wanting to be consistent and provide an easy place for future work to add to.
Something like:
I would expect then that accessing the params with
get_params()
returns an empty list:The current workaround is to provide a dummy value:
but this just leads to cruft that I'd rather not have.
I tried to use the
none
type to not actually generate the dummy param, but this doesn't compile in C++ due to anunused-variable
warning.The text was updated successfully, but these errors were encountered: