Skip to content

Commit

Permalink
Update client.py
Browse files Browse the repository at this point in the history
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 <node_name> <param> 
rosrun dynparam set <node_name> <param> <value>
```
Not sure of what exactly happen as it is not fully repeatable, but the solution proposed in issue ros#163 seems to do the job.
  • Loading branch information
augustinmanecy authored Mar 3, 2021
1 parent e9f8fa8 commit e86520c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dynamic_reconfigure/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

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

0 comments on commit e86520c

Please sign in to comment.