Skip to content

Commit

Permalink
fixed error with not being able to find unpack_parameter_dict when us…
Browse files Browse the repository at this point in the history
…ing set_params_from_dict (#220)
  • Loading branch information
Glonks authored Oct 27, 2024
1 parent 4ad0857 commit 6ba8e67
Showing 1 changed file with 3 additions and 4 deletions.
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

0 comments on commit 6ba8e67

Please sign in to comment.