rqt_reconfigure publishes too often [closed]

asked 2014-08-20 06:23:56 -0500

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 the rqt_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 the rqt_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 with level).
  • 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.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Sebastian Höffner
close date 2014-08-20 19:21:39.827962

Comments

This is almost certainly a bug. Can you file it against the rqt_reconfigure bug tracker?

ahendrix gravatar image ahendrix  ( 2014-08-20 10:50:58 -0500 )edit

Thank you, I just filed it.

Sebastian Höffner gravatar image Sebastian Höffner  ( 2014-08-20 11:31:08 -0500 )edit

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.

ahendrix gravatar image ahendrix  ( 2014-08-20 11:36:09 -0500 )edit

Seems it has to do with the rqt_reconfigure version in our lab, with the latest version it works. https://github.com/ros-visualization/...

Sebastian Höffner gravatar image Sebastian Höffner  ( 2014-08-20 12:05:56 -0500 )edit