diff --git a/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/python/parameter_library_header b/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/python/parameter_library_header index 2247da3..0bfb5b5 100644 --- a/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/python/parameter_library_header +++ b/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/python/parameter_library_header @@ -54,8 +54,7 @@ stamp_ = Time() def is_old(self, other_param): return self.params_.stamp_ != other_param.stamp_ - @staticmethod - def unpack_parameter_dict(namespace: str, parameter_dict: dict): + def unpack_parameter_dict(self, namespace: str, parameter_dict: dict): """ Flatten a parameter dictionary recursively. @@ -68,7 +67,7 @@ stamp_ = Time() full_param_name = namespace + param_name # Unroll nested parameters if isinstance(param_value, dict): - nested_params = unpack_parameter_dict( + nested_params = self.unpack_parameter_dict( namespace=full_param_name + rclpy.parameter.PARAMETER_SEPARATOR_STRING, parameter_dict=param_value) parameters.extend(nested_params) @@ -77,7 +76,7 @@ stamp_ = Time() return parameters def set_params_from_dict(self, param_dict): - params_to_set = unpack_parameter_dict('', param_dict) + params_to_set = self.unpack_parameter_dict('', param_dict) self.update(params_to_set) def refresh_dynamic_parameters(self):