rqt_reconfigure publishes too often [closed]
Introduction
I built a node (on hydro, wet) which publishes a mesh. The path to the mesh can be reconfigured dynamically using dynamic_reconfigure and whenever it is changed to a valid path the node tries to load the new mesh. However, when I used rqt_reconfigure (alone or inside rqt_gui) I realized that the node would load the mesh (i.e. call the callback) twice.
Tests
To investigate this further I implemented a small test package which does nothing but listen to one reconfiguration parameter.
What I found out:
Callbacks
- When you change a setting in the
rqt_reconfigure
the callback will be called twice. - When you use
rosrun dynamic_reconfigure dynparam
the callback will be called once, as expected. - When you use
rosrun dynamic_reconfigure dynparam
while having therqt_reconfigure
active things get worse: the change is propagated to the gui which then changes its values and detects those changes as a new change as well, resulting in additional calls (depending on the number of variables changed). - When you use
rosrun dynamic_reconfigure dynparam
while having therqt_reconfigure
active and you don't "change" a variable (i.e. set a value from 1 to 1),rqt_reconfigure
doesn't get noticed (see below, seems to have to do withlevel
). - When you start
rqt_reconfigure
while your node is running and click on the topic to configure, the callback gets called twice. However, if you now disable the view again and rechoose it, the callback gets called only once. I would expect it here not to be called at all, since you didn't change anything, or at least you didn't have the intention to change something yet.
Level
The level however seems to change correctly. In all cases mentioned above only the first callback call has a level != 0
(when there really was a change - with rosrun dynamic_reconfigure dynparam
allows calls without changing values).
Questions
Is this behaviour intended? Am I supposed to check the level myself? Is this a problem of dynamic_reconfigure
itself or just the gui?
It's a bit misleading in the tutorial, since they just set the values for the bitmask to 0 there and state: "What you want to do with the level value is entirely up to you, for now it is unnecessary."
If it's intended I will change the tutorial to reflect this behaviour a bit. For now I will just change my nodes to check the levels - loading a huge mesh twice is overkill.
This is almost certainly a bug. Can you file it against the rqt_reconfigure bug tracker?
Thank you, I just filed it.
Thanks! I've suspected something like this was going on for a while, but I haven't had time to investigate deeply or put together such an excellent problem report.
Seems it has to do with the rqt_reconfigure version in our lab, with the latest version it works. https://github.com/ros-visualization/...