triangle.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import os
00004 
00005 import rospy
00006 import roslib
00007 
00008 roslib.load_manifest("hrpsys_gazebo_atlas")
00009 
00010 from std_srvs.srv import Empty
00011 
00012 from qt_gui.plugin import Plugin
00013 from python_qt_binding import loadUi
00014 from python_qt_binding.QtGui import QWidget
00015 
00016 from python_qt_binding.QtGui import QLabel, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QCheckBox, QWidget, QToolBar, QLineEdit, QPushButton
00017 from python_qt_binding.QtCore import Qt, QTimer
00018 
00019 
00020 class TriangleGUI(Plugin):
00021     def __init__(self, context):
00022         super(TriangleGUI, self).__init__(context)
00023         # Give QObjects reasonable names
00024         self.setObjectName('TriangleGUI')
00025         
00026         # Process standalone plugin command-line arguments
00027         from argparse import ArgumentParser
00028         parser = ArgumentParser()
00029         # Add argument(s) to the parser.
00030         parser.add_argument("-q", "--quiet", action="store_true",
00031                             dest="quiet",
00032                             help="Put plugin in silent mode")
00033         args, unknowns = parser.parse_known_args(context.argv())
00034         self._toolbar = QToolBar()
00035         self._toolbar.addWidget(QLabel('Triangle'))
00036         
00037                                                                 
00038         # Create a container widget and give it a layout
00039         self._container = QWidget()
00040         self._layout    = QVBoxLayout()
00041         self._container.setLayout(self._layout)
00042         
00043         self._layout.addWidget(self._toolbar)
00044 
00045         # Add a button for killing nodes
00046         self._go_button = QPushButton('Go')
00047         self._go_button.clicked.connect(self._go)
00048         self._layout.addWidget(self._go_button)
00049         
00050         self._clear_button = QPushButton('Clear')
00051         self._clear_button.clicked.connect(self._clear)
00052         self._layout.addWidget(self._clear_button)
00053         # self._step_run_button.setStyleSheet('QPushButton {color: black}')
00054         
00055         context.add_widget(self._container)
00056     def _go(self):
00057         go = rospy.ServiceProxy('/triangle_screenpoint/go', Empty)
00058         go()
00059     def _clear(self):
00060         clear = rospy.ServiceProxy('/triangle_screenpoint/cancel', Empty)
00061         clear()
00062     def shutdown_plugin(self):
00063         pass
00064     def save_settings(self, plugin_settings, instance_settings):
00065         pass
00066     def restore_settings(self, plugin_settings, instance_settings):
00067         pass
00068 
00069     
00070 
00071     


hrpsys_gazebo_atlas
Author(s): Yohei Kakiuchi
autogenerated on Wed Sep 16 2015 10:53:59