virtual_joystick_view.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # License: BSD
00004 #   https://raw.github.com/robotics-in-concert/rocon_qt_gui/license/LICENSE
00005 #
00006 ##############################################################################
00007 # Imports
00008 ##############################################################################
00009 
00010 from __future__ import division
00011 
00012 from python_qt_binding.QtCore import Qt, pyqtSlot, QUrl
00013 from python_qt_binding.QtDeclarative import QDeclarativeView
00014 
00015 import os
00016 import rospkg
00017 import sensor_msgs.msg as sensor_msgs
00018 
00019 ##############################################################################
00020 # Class
00021 ##############################################################################
00022 
00023 
00024 class QVirtualJoystickView(QDeclarativeView):
00025     """
00026     Accepts an image of a teleop compressed image type and draws that in the
00027     scene/view.
00028     """
00029 
00030     def __init__(self, parent=None):
00031         super(QVirtualJoystickView, self).__init__(parent)
00032         virtual_joystick_path = os.path.join(rospkg.RosPack().get_path('rocon_qt_library'), 'ui', 'virtual_joystick.qml')
00033         self.setSource(QUrl(virtual_joystick_path))
00034         self.setResizeMode(QDeclarativeView.SizeRootObjectToView)
00035 
00036     def joystick_feedback(self):
00037         return self.rootObject().feedback
00038 
00039     def mouse_pressed(self):
00040         return self.rootObject().mousePressed
00041 
00042     def mouse_released(self):
00043         return self.rootObject().mouseReleased


rocon_qt_library
Author(s): Donguk Lee
autogenerated on Fri Feb 12 2016 02:50:13