0
$\begingroup$

Rosanswers logo

Hello all,

I want to create a panel in RViz (part of a plugin) and this panel would contain widgets allowing me to create/modify ROS parameters.

Now, as is, my RViz panel will not be updated if the parameter gets modified outside of RViz - the parameter value displayed by RViz will be wrong. Hence my question: is there a ROS mechanism allowing to get notified on parameters value change? ...or another mechanism allowing to sync my panel?

Should I simply setup a 5Hz timer to update my panel? Or is there a better approach?

Thanks,

Antoine.


Originally posted by arennuit on ROS Answers with karma: 955 on 2015-06-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

For parameters that are expected to change, dynamic_reconfigure is generally a better solution. If that isn't an option, I believe you will have to poll for changes (like with a timer as you mentioned).


Originally posted by Dan Lazewatsky with karma: 9115 on 2015-06-23

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by jarvisschultz on 2015-06-23:
Dan's answer is good, but if you must use params, note that if you are using C++ you can reduce the overhead associated with constantly polling the parameter server by using ros::NodeHandle::getParamCached()

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.