image_snapshot.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 ##
00011 import std_srvs
00012 import std_msgs
00013 
00014 ##
00015 from qt_gui.plugin import Plugin
00016 from python_qt_binding import loadUi
00017 from python_qt_binding.QtGui import QWidget
00018 
00019 from python_qt_binding.QtGui import QLabel, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QCheckBox, QWidget, QToolBar, QLineEdit, QPushButton
00020 from python_qt_binding.QtCore import Qt, QTimer
00021 
00022 class ImageSnapShotGUI(Plugin):
00023     def __init__(self, context):
00024         super(ImageSnapShotGUI, self).__init__(context)
00025         # Give QObjects reasonable names
00026         self.setObjectName('ImageSnapShotGUI')
00027 
00028         # Process standalone plugin command-line arguments
00029         from argparse import ArgumentParser
00030         parser = ArgumentParser()
00031         # Add argument(s) to the parser.
00032         parser.add_argument("-q", "--quiet", action="store_true",
00033                             dest="quiet",
00034                             help="Put plugin in silent mode")
00035         args, unknowns = parser.parse_known_args(context.argv())
00036         self._toolbar = QToolBar()
00037         self._toolbar.addWidget(QLabel('ImageSnapShot'))
00038 
00039         # Create a container widget and give it a layout
00040         self._container = QWidget()
00041         self._layout    = QVBoxLayout()
00042         self._container.setLayout(self._layout)
00043         self._layout.addWidget(self._toolbar)
00044 
00045         # Add a button for ....
00046         self._go_button = QPushButton('Head')
00047         self._go_button.clicked.connect(self._head)
00048         self._layout.addWidget(self._go_button)
00049 
00050         self._clear_button = QPushButton('Larm')
00051         self._clear_button.clicked.connect(self._larm)
00052         self._layout.addWidget(self._clear_button)
00053 
00054         self._clear_button = QPushButton('Rarm')
00055         self._clear_button.clicked.connect(self._rarm)
00056         self._layout.addWidget(self._clear_button)
00057 
00058         self._clear_button = QPushButton('L FishEye')
00059         self._clear_button.clicked.connect(self._lfisheye)
00060         self._layout.addWidget(self._clear_button)
00061 
00062         self._clear_button = QPushButton('R FishEye')
00063         self._clear_button.clicked.connect(self._rfisheye)
00064         self._layout.addWidget(self._clear_button)
00065 
00066         # self._step_run_button.setStyleSheet('QPushButton {color: black}')
00067         context.add_widget(self._container)
00068 
00069         self._head_pub = rospy.Publisher('/head_snap/snapshot', std_msgs.msg.Empty)
00070         self._lhand_pub = rospy.Publisher('/lhand_snap/snapshot', std_msgs.msg.Empty)
00071         self._rhand_pub = rospy.Publisher('/rhand_snap/snapshot', std_msgs.msg.Empty)
00072         self._lfisheye_pub = rospy.Publisher('/lfisheye_snap/snapshot', std_msgs.msg.Empty)
00073         self._rfisheye_pub = rospy.Publisher('/rfisheye_snap/snapshot', std_msgs.msg.Empty)
00074 
00075     def _head(self):
00076         #go = rospy.ServiceProxy('/head_snap/snapshot', std_srvs.srv.Empty)
00077         #go()
00078         self._head_pub.publish(std_msgs.msg.Empty())
00079     def _larm(self):
00080         #go = rospy.ServiceProxy('/lhand_snap/snapshot', std_srvs.srv.Empty)
00081         #go()
00082         self._lhand_pub.publish(std_msgs.msg.Empty())
00083     def _rarm(self):
00084         #go = rospy.ServiceProxy('/rhand_snap/snapshot', std_srvs.srv.Empty)
00085         #go()
00086         self._rhand_pub.publish(std_msgs.msg.Empty())
00087     def _lfisheye(self):
00088         #go = rospy.ServiceProxy('/lfisheye_snap/snapshot', std_srvs.srv.Empty)
00089         #go()
00090         self._lfisheye_pub.publish(std_msgs.msg.Empty())
00091     def _rfisheye(self):
00092         #go = rospy.ServiceProxy('/rfisheye_snap/snapshot', std_srvs.srv.Empty)
00093         #go()
00094         self._rfisheye_pub.publish(std_msgs.msg.Empty())
00095 
00096     def shutdown_plugin(self):
00097         pass
00098     def save_settings(self, plugin_settings, instance_settings):
00099         pass
00100     def restore_settings(self, plugin_settings, instance_settings):
00101         pass


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