Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix error with not being able to find unpack_parameter_dict when using set_params_from_dict #220

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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)
Expand All @@ -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):
Expand Down
Loading