my_module.py
Go to the documentation of this file.
00001 import os
00002 import roslib
00003 roslib.load_manifest('pr2_motor_diagnostic_tool')
00004 import rospy
00005 
00006 from qt_gui.plugin import Plugin
00007 from diagnostic_tool_widget import DiagnosticToolWidget
00008 
00009 class MyPlugin(Plugin):
00010 
00011     def __init__(self, context):
00012         super(MyPlugin, self).__init__(context)
00013         # give QObjects reasonable names
00014         self.setObjectName('MyPlugin')
00015 
00016         # create QWidget
00017         self._widget = DiagnosticToolWidget()
00018         # get path to UI file which is a sibling of this file
00019         # in this example the .ui file is in the same folder as this Python file
00020         #ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'MyPlugin.ui')
00021         # extend the widget with all attributes and children from UI file
00022         #       loadUi(ui_file, self._widget)
00023         # give QObjects reasonable names
00024         #self._widget.setObjectName('MyPluginUi')
00025         # add widget to the user interface
00026         context.add_widget(self._widget)
00027 
00028     def shutdown_plugin(self):
00029         # TODO unregister all publishers here
00030         self._widget.close_all()
00031     def save_settings(self, plugin_settings, instance_settings):
00032         # TODO save intrinsic configuration, usually using:
00033         # instance_settings.set_value(k, v)
00034         pass
00035 
00036     def restore_settings(self, plugin_settings, instance_settings):
00037         # TODO restore intrinsic configuration, usually using:
00038         # v = instance_settings.value(k)
00039         pass
00040 
00041     #def trigger_configuration(self):
00042         # Comment in to signal that the plugin has a way to configure it
00043         # Usually used to open a dialog to offer the user a set of configuration


pr2_motor_diagnostic_tool
Author(s): Rahul Udasi
autogenerated on Mon Sep 14 2015 14:39:22