ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Why would you want to get a callback when nothing changes? Your dynamic reconfigure callback will be called:

  • once, when your node is loaded, to pass the initial parameter settings
  • after that only when something changes, e.g. through the GUI

I guess what you mean by "my code is stuck then" is that you put some other code into the callback that you want to have executed regularly (independent from whether a dynamic reconfigure setting changes). The solution is to simply put that code into your while (true) loop. And move the setCallback() call out of that loop, it should only be called once.

If you need to access the dynamic reconfigure config from your main code (you probably do), just save the config to a member variable in your callback and read that variable from your main loop.