19 from python_qt_binding
import loadUi
20 from python_qt_binding.QtGui
import QWidget
21 from python_qt_binding
import QtGui
22 from std_msgs.msg
import Int8, Empty
27 super(SVHResetGui, self).
__init__(context)
29 self.setObjectName(
'TrajectoryDesigner')
32 from argparse
import ArgumentParser
33 parser = ArgumentParser()
35 parser.add_argument(
"-q",
"--quiet", action=
"store_true",
37 help=
"Put plugin in silent mode")
38 args, unknowns = parser.parse_known_args(context.argv())
44 ui_file = os.path.join(rp.get_path(
'schunk_svh_driver'),
'resource',
'SVHResetGui.ui')
46 self._widget.setObjectName(
'SVHResetGuiUI')
47 if context.serial_number() > 1:
48 self._widget.setWindowTitle(self._widget.windowTitle() + (
' (%d)' % context.serial_number()))
50 context.add_widget(self.
_widget)
52 self._widget.connect_button.clicked[bool].connect(self.
ConnectButton)
53 self._widget.reset_button.clicked[bool].connect(self.
ResetButton)
54 self._widget.enable_button.clicked[bool].connect(self.
EnableButton)
56 self._widget.finger_select_box.addItem(
"All",-1)
57 self._widget.finger_select_box.addItem(
"Thumb Flexion",0)
58 self._widget.finger_select_box.addItem(
"Thumb Opposition",1)
59 self._widget.finger_select_box.addItem(
"Index Finger Distal",2)
60 self._widget.finger_select_box.addItem(
"Index Finger Proximal",3)
61 self._widget.finger_select_box.addItem(
"Middle Finger Distal",4)
62 self._widget.finger_select_box.addItem(
"Middle Finger Proximal",5)
63 self._widget.finger_select_box.addItem(
"Ring Finger",6)
64 self._widget.finger_select_box.addItem(
"Pinky Finger",7)
65 self._widget.finger_select_box.addItem(
"Finger Spread",8)
67 self.
reset_pub = rospy.Publisher(
'svh_controller/reset_channel', Int8, queue_size=1)
68 self.
enable_pub = rospy.Publisher(
'svh_controller/enable_channel', Int8, queue_size=1)
69 self.
connect_pub = rospy.Publisher(
'svh_controller/connect', Empty, queue_size=1)
73 self.connect_pub.publish(Empty())
74 print "ConnectButton\n" 77 selected = self._widget.finger_select_box.itemData(self._widget.finger_select_box.currentIndex())
78 self.reset_pub.publish(Int8(selected))
79 print "Reset\n" + str(selected)
83 selected = self._widget.finger_select_box.itemData(self._widget.finger_select_box.currentIndex())
84 self.enable_pub.publish(Int8(selected))
85 print "Enabled\n" + str(selected)
def __init__(self, context)