From e86520c4b89bfbb9f8914cb8b806d42657a884e5 Mon Sep 17 00:00:00 2001 From: augustinmanecy Date: Wed, 3 Mar 2021 21:50:15 +0100 Subject: [PATCH] Update client.py When using rqt_reconfigure with node with a lot of parameters, it seems some parameters are most of time not found when trying to update the configuration. The parameters are listed in rqt_dynamic_reconfigure, but when trying to change value of some parameters "update_configuration" raise the exception line 185: ```bash error updating parameters: don't know parameter xxx ``` rqt_reconfigure returns: ```bash ``` When equivalent commands set and get succed each time: ```bash rosrun dynparam get rosrun dynparam set ``` Not sure of what exactly happen as it is not fully repeatable, but the solution proposed in issue #163 seems to do the job. --- src/dynamic_reconfigure/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dynamic_reconfigure/client.py b/src/dynamic_reconfigure/client.py index fa18841b..b27f5c39 100644 --- a/src/dynamic_reconfigure/client.py +++ b/src/dynamic_reconfigure/client.py @@ -76,6 +76,7 @@ def __init__(self, name, timeout=None, config_callback=None, description_callbac self.group_description = None self._param_types = None + self._param_types_initialized = False self._cv = threading.Condition() @@ -128,14 +129,14 @@ def get_parameter_descriptions(self, timeout=None): """ if timeout is None or timeout == 0.0: with self._cv: - while self.param_description is None: + while self._param_types_initialized is False: if rospy.is_shutdown(): return None self._cv.wait() else: start_time = time.time() with self._cv: - while self.param_description is None: + while self._param_types_initialized is False: if rospy.is_shutdown(): return None secs_left = timeout - (time.time() - start_time) @@ -337,6 +338,7 @@ def _descriptions_msg(self, msg): if n is not None and t is not None: self._param_types[n] = self._param_type_from_string(t) + self._param_types_initialized = True with self._cv: self._cv.notifyAll() if self._description_callback is not None: