Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 import dynamic_reconfigure.client
00036 import rospy
00037
00038 from .param_editors import EditorWidget, BooleanEditor, DoubleEditor, EnumEditor, IntegerEditor, StringEditor
00039 from .param_groups import GroupWidget
00040 from .param_updater import ParamUpdater
00041
00042 class ClientWidget(GroupWidget):
00043 """
00044 A wrapper of dynamic_reconfigure.client instance.
00045 Represents the pane on right side where you modify params.
00046 """
00047
00048 def __init__(self, reconf):
00049 """
00050 @type reconf: dynamic_reconfigure.client.
00051 """
00052
00053 super(ClientWidget, self).__init__(ParamUpdater(reconf),
00054 reconf.get_group_descriptions())
00055
00056 self.setMinimumWidth(150)
00057
00058 self.reconf = reconf
00059
00060 self.updater.start()
00061 self.reconf.config_callback = self.config_callback
00062
00063 def config_callback(self, config):
00064 if config is not None:
00065
00066 names = [name for name, v in config.items()]
00067
00068 for widget in self.editor_widgets:
00069 if isinstance(widget, EditorWidget):
00070 if widget.name in names:
00071 rospy.logdebug('EDITOR widget.name=%s', widget.name)
00072 widget.update_value(config[widget.name])
00073 elif isinstance(widget, GroupWidget):
00074 cfg = find_cfg(config, widget.name)
00075 rospy.logdebug('GROUP widget.name=%s', widget.name)
00076 widget.update_group(cfg)
00077
00078 def close(self):
00079 self.reconf.close()
00080 self.updater.stop()
00081
00082 for w in self.editor_widgets:
00083 w.close()
00084
00085 self.deleteLater()