3
# Copyright 2011 Shadow Robot Company Ltd.
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by the Free
7
# Software Foundation, either version 2 of the License, or (at your option)
10
# This program is distributed in the hope that it will be useful, but WITHOUT
11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15
# You should have received a copy of the GNU General Public License along
16
# with this program. If not, see <http://www.gnu.org/licenses/>.
19
import roslib; roslib.load_manifest('sr_control_gui')
22
from shadowhand_ros import ShadowHand_ROS
23
from PyQt4 import QtCore, QtGui, Qt
25
from generic_plugin import GenericPlugin
28
class ShadowGenericPlugin(GenericPlugin):
30
The mother of all plugins using the shadow robot ROS interface (Hand and Arm).
32
name = "Shadow Robot Generic Plugin"
35
GenericPlugin.__init__(self)
38
GenericPlugin.activate(self)
39
# only activate the library if it hasn't been already loaded
40
if self.parent.parent.libraries.get("sr_library") == None:
41
self.parent.emit(QtCore.SIGNAL("messageToStatusbar(QString)"),
42
"Loading Shadowhand Library...")
43
self.parent.parent.libraries["sr_library"] = ShadowHand_ROS()
44
self.parent.emit(QtCore.SIGNAL("messageToStatusbar(QString)"),
45
"Shadowhand Library Loaded.")
48
GenericPlugin.on_close(self)
51
return Config.shadowhand_plugin_config.dependencies