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

Do getParamCached() and dynamic_reconfigure have the same functions?

asked 2020-07-29 00:23:06 -0600

naegling77 gravatar image

I want to reflect the changes in the parameters, in my node during run-time. In such a situation, which would be better to implement: getParamCached() or the dynamic_reconfigure package?

I know that the dynamic_reconfigure requires creating a cfg file. But getParamCached() can be implemented without any additional files.

So my question is if there would be a use case where dynamic_reconfigure implementation is advantageous over getParamCached()

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-07-29 01:26:36 -0600

mgruhler gravatar image

The way I understand it, they are totally different.

getParamCached provides local caching of values and gets notified once the parameter on the master changed somehow. However, you still have to call getParamCached regularly to get the notifications. I.e., you don't call it once in your constructor, e.g., and get all updates to the respective parameter.

dynamic_reconfigure however really provides the ability to change parameters dynamically via a callback based mechanism. So you don't have to call something regularly yourself, you just register the callback and this handles notifying you once a parameter changed.

Thus, I'd say dynamic_reconfigure is the way to go. getParamCached would probably work if this is really for a single parameter.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-07-29 00:23:06 -0600

Seen: 146 times

Last updated: Jul 29 '20