From a9e8a2b3b67d8dd39df3c22800a80b424af95c62 Mon Sep 17 00:00:00 2001 From: Aitor Martinez Date: Tue, 27 Jun 2017 16:35:44 +0200 Subject: [PATCH 1/2] [issue #821] Created pantilt_teleop --- .../parallelIce_py/parallelIce/ptMotors.py | 123 ++++++++++ src/tools/pantilt_teleop_py/CMakeLists.txt | 28 +++ src/tools/pantilt_teleop_py/generateGUI | 9 + src/tools/pantilt_teleop_py/gui/GUI.py | 82 +++++++ src/tools/pantilt_teleop_py/gui/__init__.py | 1 + .../pantilt_teleop_py/gui/cameraWidget.py | 53 +++++ .../pantilt_teleop_py/gui/communicator.py | 24 ++ src/tools/pantilt_teleop_py/gui/logoWidget.py | 44 ++++ .../pantilt_teleop_py/gui/teleopWidget.py | 113 +++++++++ src/tools/pantilt_teleop_py/gui/threadGUI.py | 46 ++++ src/tools/pantilt_teleop_py/gui/ui_gui.py | 57 +++++ src/tools/pantilt_teleop_py/gui/ui_gui.ui | 119 ++++++++++ .../pantilt_teleop_py/pantilt_teleop.cfg | 3 + src/tools/pantilt_teleop_py/pantilt_teleop.in | 3 + src/tools/pantilt_teleop_py/pantilt_teleop.py | 51 ++++ .../pantilt_teleop_py/resources/__init__.py | 0 .../pantilt_teleop_py/resources/ball.png | Bin 0 -> 1869 bytes .../pantilt_teleop_py/resources/jderobot.svg | 11 + .../pantilt_teleop_py/resources/resources.qrc | 6 + src/tools/pantilt_teleop_py/resources_rc.py | 224 ++++++++++++++++++ 20 files changed, 997 insertions(+) create mode 100644 src/libs/parallelIce_py/parallelIce/ptMotors.py create mode 100644 src/tools/pantilt_teleop_py/CMakeLists.txt create mode 100755 src/tools/pantilt_teleop_py/generateGUI create mode 100644 src/tools/pantilt_teleop_py/gui/GUI.py create mode 100644 src/tools/pantilt_teleop_py/gui/__init__.py create mode 100644 src/tools/pantilt_teleop_py/gui/cameraWidget.py create mode 100644 src/tools/pantilt_teleop_py/gui/communicator.py create mode 100644 src/tools/pantilt_teleop_py/gui/logoWidget.py create mode 100644 src/tools/pantilt_teleop_py/gui/teleopWidget.py create mode 100644 src/tools/pantilt_teleop_py/gui/threadGUI.py create mode 100644 src/tools/pantilt_teleop_py/gui/ui_gui.py create mode 100644 src/tools/pantilt_teleop_py/gui/ui_gui.ui create mode 100644 src/tools/pantilt_teleop_py/pantilt_teleop.cfg create mode 100644 src/tools/pantilt_teleop_py/pantilt_teleop.in create mode 100755 src/tools/pantilt_teleop_py/pantilt_teleop.py create mode 100644 src/tools/pantilt_teleop_py/resources/__init__.py create mode 100644 src/tools/pantilt_teleop_py/resources/ball.png create mode 100644 src/tools/pantilt_teleop_py/resources/jderobot.svg create mode 100644 src/tools/pantilt_teleop_py/resources/resources.qrc create mode 100644 src/tools/pantilt_teleop_py/resources_rc.py diff --git a/src/libs/parallelIce_py/parallelIce/ptMotors.py b/src/libs/parallelIce_py/parallelIce/ptMotors.py new file mode 100644 index 000000000..f50e33405 --- /dev/null +++ b/src/libs/parallelIce_py/parallelIce/ptMotors.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 1997-2016 JDE Developers Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# Authors : +# Aitor Martinez Fernandez +# + +import traceback +import jderobot +import threading +import Ice +from parallelIce.threadSensor import ThreadSensor + + +class PTMotors: + + def __init__(self, ic, prefix): + self.lock = threading.Lock() + + self.data=jderobot.PTMotorsData() + + self.params=jderobot.PTMotorsParams() + prop = ic.getProperties() + + try: + base = ic.propertyToProxy(prefix+".Proxy") + self.proxy = jderobot.PTMotorsPrx.checkedCast(base) + + if not self.proxy: + print ('Interface ' + prefix + ' not configured') + + else: + self.params = self.proxy.getPTMotorsParams() + + print ("+++ MAX/MIN Pan/Tilt Values +++") + print ("+ Min Pan: " + str(self.params.minPan) + "º +") + print ("+ Max Pan: " + str(self.params.maxPan) + "º +") + print ("+ Max Pan speed: " + str(self.params.maxPanSpeed) + " +") + print ("+ Min Tilt: " + str(self.params.minTilt) + "º +") + print ("+ Max Tilt: " + str(self.params.maxTilt) + "º +") + print ("+ Max Tilt speed: " + str(self.params.maxTiltSpeed) + " +") + print ("++++++++++++++++++++++++++++++") + + except Ice.ConnectionRefusedException: + print(prefix + ': connection refused') + + except: + traceback.print_exc() + exit(-1) + + def getLimits(self): + self.lock.acquire() + params = self.params + self.lock.release() + + return params + + def setPTMotorsData(self, pan, tilt, panspeed, tiltspeed): + + self.lock.acquire() + self.data.pan = pan + self.data.tilt = tilt + self.data.panSpeed = panspeed + self.data.tiltSpeed = tiltspeed + self.lock.release() + + + + def sendPTMotorsData(self): + if self.hasproxy(): + self.lock.acquire() + self.proxy.setPTMotorsData(self.data) + self.lock.release() + + def hasproxy (self): + return hasattr(self,"proxy") and self.proxy + + def update(self): + self.sendPTMotorsData() + + + +class PTMotorsClient: + def __init__(self,ic,prefix, start = False): + self.motors = PTMotors(ic,prefix) + + self.kill_event = threading.Event() + self.thread = ThreadSensor(self.motors, self.kill_event) + self.thread.daemon = True + + if start: + self.start() + + # if client is stopped you can not start again, Threading.Thread raised error + def start(self): + self.kill_event.clear() + self.thread.start() + + # if client is stopped you can not start again + def stop(self): + self.kill_event.set() + + def getLimits(self): + return self.motors.getLimits() + + def hasproxy(): + return self.motors.hasproxy() + + def setPTMotorsData(self, pan, tilt, panspeed, tiltspeed): + self.motors.setPTMotorsData(pan, tilt, panspeed, tiltspeed) \ No newline at end of file diff --git a/src/tools/pantilt_teleop_py/CMakeLists.txt b/src/tools/pantilt_teleop_py/CMakeLists.txt new file mode 100644 index 000000000..0d58af35e --- /dev/null +++ b/src/tools/pantilt_teleop_py/CMakeLists.txt @@ -0,0 +1,28 @@ + +configure_file( + pantilt_teleop.in + pantilt_teleop + @ONLY +) + +## INSTALL ## + +# install Launcher +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/pantilt_teleop + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ + DESTINATION bin +) + +# Install .py +FILE(GLOB_RECURSE HEADERS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*py) +FOREACH(header ${HEADERS_FILES}) + INSTALL(FILES ${header} DESTINATION share/jderobot/python/pantilt_teleop_py/ COMPONENT tools) +ENDFOREACH(header) + +# Install gui +INSTALL (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gui DESTINATION share/jderobot/python/pantilt_teleop_py COMPONENT tools PATTERN .svn EXCLUDE) + +# Install resources +#INSTALL (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources DESTINATION share/jderobot/python/pantilt_teleop_py COMPONENT tools PATTERN .svn EXCLUDE) +INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/pantilt_teleop.cfg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot/conf) diff --git a/src/tools/pantilt_teleop_py/generateGUI b/src/tools/pantilt_teleop_py/generateGUI new file mode 100755 index 000000000..d2d26b788 --- /dev/null +++ b/src/tools/pantilt_teleop_py/generateGUI @@ -0,0 +1,9 @@ +#!/bin/bash + cd resources + pyrcc5 resources.qrc -o resources_rc.py + mv resources_rc.py .. + + cd ../gui + pyuic5 ui_gui.ui > ui_gui.py + cd .. + diff --git a/src/tools/pantilt_teleop_py/gui/GUI.py b/src/tools/pantilt_teleop_py/gui/GUI.py new file mode 100644 index 000000000..1bf046aad --- /dev/null +++ b/src/tools/pantilt_teleop_py/gui/GUI.py @@ -0,0 +1,82 @@ +# +# Copyright (C) 1997-2016 JDE Developers Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# Authors : +# Alberto Martin Florido +# Aitor Martinez Fernandez +# + + +from PyQt5.QtCore import pyqtSignal +from PyQt5.QtWidgets import QMainWindow +from .ui_gui import Ui_MainWindow +from .teleopWidget import TeleopWidget +from .cameraWidget import CameraWidget +from .communicator import Communicator +from .logoWidget import LogoWidget + + +class MainWindow(QMainWindow, Ui_MainWindow): + + updGUI = pyqtSignal() + + def __init__(self, parent=None): + super(MainWindow, self).__init__(parent) + self.setupUi(self) + self.teleop = TeleopWidget(self) + self.tlLayout.addWidget(self.teleop) + self.teleop.setVisible(True) + + self.logo = LogoWidget(self, self.logoLayout.parent().width(), self.logoLayout.parent().height()) + self.logoLayout.addWidget(self.logo) + self.logo.setVisible(True) + + self.updGUI.connect(self.updateGUI) + + self.cameraWidget = CameraWidget(self) + + self.cameraCommunicator = Communicator() + self.trackingCommunicator = Communicator() + + def setCamera(self, camera): + self.camera = camera + self.cameraWidget.show() + + def getCamera(self): + return self.camera + + def setMotors(self, motors): + self.motors = motors + + def getMotors(self): + return self.motors + + def updateGUI(self): + self.cameraWidget.imageUpdate.emit() + + def setXYValues(self, newX, newY): + limits = self.motors.getLimits() + pan = newX*limits.maxPan + tilt = - newY*limits.maxTilt + + + + self.YValue.setText(str(tilt)) + self.XValue.setText(str(pan)) + #self.YValue.setText("{:.0f}".format(tilt)) + #self.XValue.setText("{:.0f}".format(pan)) + if (self.motors): + self.motors.setPTMotorsData(pan, tilt, limits.maxPanSpeed, limits.maxTiltSpeed) + diff --git a/src/tools/pantilt_teleop_py/gui/__init__.py b/src/tools/pantilt_teleop_py/gui/__init__.py new file mode 100644 index 000000000..40a96afc6 --- /dev/null +++ b/src/tools/pantilt_teleop_py/gui/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/src/tools/pantilt_teleop_py/gui/cameraWidget.py b/src/tools/pantilt_teleop_py/gui/cameraWidget.py new file mode 100644 index 000000000..68418e95f --- /dev/null +++ b/src/tools/pantilt_teleop_py/gui/cameraWidget.py @@ -0,0 +1,53 @@ +# +# Copyright (C) 1997-2016 JDE Developers Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# Authors : +# Alberto Martin Florido +# Aitor Martinez Fernandez +# +from PyQt5 import QtWidgets, QtCore +from PyQt5.QtGui import QImage, QPixmap + + +class CameraWidget(QtWidgets.QWidget): + + imageUpdate = QtCore.pyqtSignal() + + def __init__(self, winParent): + super(CameraWidget, self).__init__() + self.winParent = winParent + self.imageUpdate.connect(self.updateImage) + self.initUI() + + def initUI(self): + + self.setWindowTitle("Camera") + self.setMinimumSize(100,100) + + self.imgLabel = QtWidgets.QLabel(self) + self.imgLabel.show() + + def updateImage(self): + + if (self.winParent.getCamera()): + img = self.winParent.getCamera().getImage() + if img is not None: + image = QImage(img.data, img.shape[1], img.shape[0], + img.shape[1] * img.shape[2], QImage.Format_RGB888) + + size = QtCore.QSize(img.shape[1], img.shape[0]) + self.resize(size) + self.imgLabel.resize(size) + self.imgLabel.setPixmap(QPixmap.fromImage(image)) diff --git a/src/tools/pantilt_teleop_py/gui/communicator.py b/src/tools/pantilt_teleop_py/gui/communicator.py new file mode 100644 index 000000000..ac7c1a026 --- /dev/null +++ b/src/tools/pantilt_teleop_py/gui/communicator.py @@ -0,0 +1,24 @@ +# +# Copyright (C) 1997-2015 JDE Developers Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# Authors : +# Alberto Martin Florido +# +#!/usr/bin/python +# -*- coding: utf-8 -*- + +from PyQt5 import QtCore +class Communicator(QtCore.QObject): + updateBW = QtCore.pyqtSignal() diff --git a/src/tools/pantilt_teleop_py/gui/logoWidget.py b/src/tools/pantilt_teleop_py/gui/logoWidget.py new file mode 100644 index 000000000..3e7b80b02 --- /dev/null +++ b/src/tools/pantilt_teleop_py/gui/logoWidget.py @@ -0,0 +1,44 @@ +# +# Copyright (C) 1997-2015 JDE Developers Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# Authors : +# Alberto Martin Florido +# +import resources_rc +from PyQt5 import QtGui +from PyQt5.QtCore import pyqtSignal, QPointF, Qt, QPoint +from PyQt5.QtWidgets import QWidget, QGridLayout + +class LogoWidget(QWidget): + + def __init__(self,winParent, width=0, height=0): + super(LogoWidget, self).__init__() + self.winParent=winParent + qimage=QtGui.QImage() + qimage.load(':images/jderobot.svg') + if (width != 0 and height != 0): + self.qimage = qimage.scaled(0.8*width, 0.8*height, Qt.KeepAspectRatio) + #self.qimage = qimage.scaled(0.8*width, 0.8*height) + self.resize(width, height) + else: + self.qimage = qimage + + + def paintEvent(self, e): + + painter=QtGui.QPainter(self) + painter.drawImage(self.width()/2-self.qimage.width()/2, self.height()/2-self.qimage.height()/2, self.qimage) + + diff --git a/src/tools/pantilt_teleop_py/gui/teleopWidget.py b/src/tools/pantilt_teleop_py/gui/teleopWidget.py new file mode 100644 index 000000000..02a067fa7 --- /dev/null +++ b/src/tools/pantilt_teleop_py/gui/teleopWidget.py @@ -0,0 +1,113 @@ +# +# Copyright (C) 1997-2015 JDE Developers Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# Authors : +# Alberto Martin Florido +# +import resources_rc +from PyQt5.QtGui import QImage, QPainter, QPen +from PyQt5.QtCore import pyqtSignal, QPointF, Qt, QPoint +from PyQt5.QtWidgets import QWidget, QGridLayout + +class TeleopWidget(QWidget): + + stopSIG=pyqtSignal() + + def __init__(self,winParent): + super(TeleopWidget, self).__init__() + self.winParent=winParent + self.line = QPointF(0, 0); + self.qimage=QImage() + self.qimage.load(':images/ball.png') + self.stopSIG.connect(self.stop) + self.initUI() + + def initUI(self): + layout=QGridLayout() + self.setLayout(layout) + self.setAutoFillBackground(True) + p = self.palette() + p.setColor(self.backgroundRole(), Qt.black) + self.setPalette(p) + self.resize(300,300) + self.setMinimumSize(300,300) + + def stop(self): + self.line = QPointF(0, 0); + self.repaint(); + + def mouseMoveEvent(self,e): + if e.buttons() == Qt.LeftButton: + x = e.x()-self.width()/2 + y = e.y()-self.height()/2 + self.line = QPointF(x, y) + self.repaint() + + def paintEvent(self, e): + _width = self.width() + _height = self.height() + + + width = 2 + + painter=QPainter(self) + + pen = QPen(Qt.blue, width) + painter.setPen(pen) + + #Centro del widget + painter.translate(QPoint(_width/2, _height/2)) + + #eje + painter.drawLine(QPointF(-_width, 0), + QPointF( _width, 0)) + + painter.drawLine(QPointF(0, -_height), + QPointF(0, _height)) + + #con el raton + pen = QPen(Qt.red, width) + painter.setPen(pen) + + #Comprobamos que el raton este dentro de los limites + if abs(self.line.x()*2) >= self.size().width(): + if self.line.x()>=0: + self.line.setX(self.size().width()/2) + elif self.line.x()<0: + self.line.setX((-self.size().width()/2)+1) + + if abs(self.line.y()*2) >= self.size().height(): + if self.line.y()>=0: + self.line.setY(self.size().height()/2) + elif self.line.y()<0: + self.line.setY((-self.size().height()/2)+1) + + painter.drawLine(QPointF(self.line.x(), -_height), + QPointF(self.line.x(), _height)) + + painter.drawLine(QPointF(-_width, self.line.y()), + QPointF( _width, self.line.y())) + + #print "x: %f y: %f" % (self.line.x(), self.line.y()) + + v_normalized = (1.0/(self.size().height()/2)) * self.line.y() + v_normalized = float("{0:.2f}".format(v_normalized)) + w_normalized = (1.0/(self.size().width()/2)) * self.line.x() + w_normalized = float("{0:.2f}".format(w_normalized)) + + #print "v: %f w: %f" % (v_normalized,w_normalized) + self.winParent.setXYValues(w_normalized,v_normalized) + painter.drawImage(self.line.x()-self.qimage.width()/2, self.line.y()-self.qimage.height()/2, self.qimage); + diff --git a/src/tools/pantilt_teleop_py/gui/threadGUI.py b/src/tools/pantilt_teleop_py/gui/threadGUI.py new file mode 100644 index 000000000..fcd4a4ef4 --- /dev/null +++ b/src/tools/pantilt_teleop_py/gui/threadGUI.py @@ -0,0 +1,46 @@ +# +# Copyright (C) 1997-2016 JDE Developers Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# Authors : +# Alberto Martin Florido +# Aitor Martinez Fernandez +# +import threading +import time +from datetime import datetime + +time_cycle = 50 + + +class ThreadGUI(threading.Thread): + def __init__(self, gui): + self.gui = gui + + threading.Thread.__init__(self) + + def run(self): + + while(True): + + start_time = datetime.now() + self.gui.updGUI.emit() + + finish_Time = datetime.now() + + dt = finish_Time - start_time + ms = (dt.days * 24 * 60 * 60 + dt.seconds) * 1000 + dt.microseconds / 1000.0 + + if(ms < time_cycle): + time.sleep((time_cycle - ms) / 1000.0) \ No newline at end of file diff --git a/src/tools/pantilt_teleop_py/gui/ui_gui.py b/src/tools/pantilt_teleop_py/gui/ui_gui.py new file mode 100644 index 000000000..151b47231 --- /dev/null +++ b/src/tools/pantilt_teleop_py/gui/ui_gui.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'ui_gui.ui' +# +# Created by: PyQt5 UI code generator 5.5.1 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(430, 400) + MainWindow.setMinimumSize(QtCore.QSize(430, 400)) + MainWindow.setMaximumSize(QtCore.QSize(800, 800)) + self.centralwidget = QtWidgets.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget) + self.verticalLayoutWidget.setGeometry(QtCore.QRect(20, 30, 361, 301)) + self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") + self.tlLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget) + self.tlLayout.setObjectName("tlLayout") + self.XLabel = QtWidgets.QLabel(self.centralwidget) + self.XLabel.setGeometry(QtCore.QRect(20, 340, 21, 21)) + self.XLabel.setObjectName("XLabel") + self.YLabel = QtWidgets.QLabel(self.centralwidget) + self.YLabel.setGeometry(QtCore.QRect(130, 340, 21, 21)) + self.YLabel.setObjectName("YLabel") + self.XValue = QtWidgets.QLabel(self.centralwidget) + self.XValue.setGeometry(QtCore.QRect(40, 340, 41, 21)) + self.XValue.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.XValue.setObjectName("XValue") + self.YValue = QtWidgets.QLabel(self.centralwidget) + self.YValue.setGeometry(QtCore.QRect(150, 340, 41, 21)) + self.YValue.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.YValue.setObjectName("YValue") + self.verticalLayoutWidget_2 = QtWidgets.QWidget(self.centralwidget) + self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(350, 320, 80, 80)) + self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2") + self.logoLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2) + self.logoLayout.setSpacing(0) + self.logoLayout.setObjectName("logoLayout") + MainWindow.setCentralWidget(self.centralwidget) + + self.retranslateUi(MainWindow) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "Pan/Tilt Teleoperator")) + self.XLabel.setText(_translate("MainWindow", "Pan:")) + self.YLabel.setText(_translate("MainWindow", "Tilt:")) + self.XValue.setText(_translate("MainWindow", "0")) + self.YValue.setText(_translate("MainWindow", "0")) + +import resources_rc diff --git a/src/tools/pantilt_teleop_py/gui/ui_gui.ui b/src/tools/pantilt_teleop_py/gui/ui_gui.ui new file mode 100644 index 000000000..726620e0c --- /dev/null +++ b/src/tools/pantilt_teleop_py/gui/ui_gui.ui @@ -0,0 +1,119 @@ + + +MainWindow + + + + 0 + 0 + 430 + 400 + + + + + 430 + 400 + + + + + 800 + 800 + + + + Pan/Tilt Teleoperator + + + + + + 20 + 30 + 361 + 301 + + + + + + + + 20 + 340 + 21 + 21 + + + + Pan: + + + + + + 130 + 340 + 21 + 21 + + + + Tilt: + + + + + + 40 + 340 + 41 + 21 + + + + 0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 150 + 340 + 41 + 21 + + + + 0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 350 + 320 + 80 + 80 + + + + + 0 + + + + + + + + + + diff --git a/src/tools/pantilt_teleop_py/pantilt_teleop.cfg b/src/tools/pantilt_teleop_py/pantilt_teleop.cfg new file mode 100644 index 000000000..a440e9e56 --- /dev/null +++ b/src/tools/pantilt_teleop_py/pantilt_teleop.cfg @@ -0,0 +1,3 @@ +UavViewer.Camera.Proxy = ardrone_camera:default -h localhost -p 9999 +PanTiltTeleop.PTMotors.Proxy = PanTilt:default -h localhost -p 9977 + diff --git a/src/tools/pantilt_teleop_py/pantilt_teleop.in b/src/tools/pantilt_teleop_py/pantilt_teleop.in new file mode 100644 index 000000000..e7b864154 --- /dev/null +++ b/src/tools/pantilt_teleop_py/pantilt_teleop.in @@ -0,0 +1,3 @@ +#!/bin/bash + +python @CMAKE_INSTALL_PREFIX@/share/jderobot/python/pantilt_teleop_py/pantilt_teleop.py $* \ No newline at end of file diff --git a/src/tools/pantilt_teleop_py/pantilt_teleop.py b/src/tools/pantilt_teleop_py/pantilt_teleop.py new file mode 100755 index 000000000..ca86f0254 --- /dev/null +++ b/src/tools/pantilt_teleop_py/pantilt_teleop.py @@ -0,0 +1,51 @@ +#!/usr/bin/python2 +# -*- coding: utf-8 -*- +# +# Copyright (C) 1997-2016 JdeRobot Developers Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# Authors : +# Aitor Martinez Fernandez +# + +import sys + +from parallelIce.cameraClient import CameraClient +from parallelIce.ptMotors import PTMotorsClient +from gui.threadGUI import ThreadGUI +from gui.GUI import MainWindow +from PyQt5.QtWidgets import QApplication +import easyiceconfig as EasyIce + +import signal + +signal.signal(signal.SIGINT, signal.SIG_DFL) + +if __name__ == '__main__': + ic = EasyIce.initialize(sys.argv) + + camera = CameraClient(ic, "PanTiltTeleop.Camera", True) + motors = PTMotorsClient(ic,"PanTiltTeleop.PTMotors", True) + + app = QApplication(sys.argv) + frame = MainWindow() + frame.setMotors(motors) + frame.setCamera(camera) + frame.show() + + t2 = ThreadGUI(frame) + t2.daemon = True + t2.start() + + sys.exit(app.exec_()) diff --git a/src/tools/pantilt_teleop_py/resources/__init__.py b/src/tools/pantilt_teleop_py/resources/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/tools/pantilt_teleop_py/resources/ball.png b/src/tools/pantilt_teleop_py/resources/ball.png new file mode 100644 index 0000000000000000000000000000000000000000..7fbb31af939a79be26b875073570e302e17909d8 GIT binary patch literal 1869 zcmV-T2eSByP)P000~a1^@s6lq3|;00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyV) z5i|#uO2rKT00zxTL_t(Y$DLN)Yh1?_|DBn;yLUen~+e~G&ZRUs*^%m z9NMNPghCrI{lG2GgWvi$G_N60KlGsnV;fpyD19l$RO*B4rqpt>Q7l<@B(MB!ue7?W z`!zG?^kG*@+`1(6z;Kzl!}-l`&Y9miz*8&?L;OG1>2#jDuAa6iB2V3X`}S=w48uG# z`$>|}7X^P}V-!UoBKW=!0BAOwsMTr}05t$*00Tti17H#9h{$8-++*k5dVha^&^rjm z$HyTeAfhKh!Z1XkQ1~o$O+;f_>(_{AnusO<^a02+vk+0p%q2^>9o6y7!^`jk|XBsCFvO+4B@-nV|Fo)Bp&tPh5 z3dfHhr+xeOAqWE3Zntkec<|t=2LL8D&p@OO0^%gZ%*?Db8uN7a>{-0{;@7cv?+X|k zABA%cCbh8E!8ryIVPm6>^|dwlzK>F=gi57?p`jrhIB?)O&+~RS8V&M#88X5mW6n7U z3zBpL>+KEPxx0$ejsk{;2ca|64Lk!7f@22)L4;AQ4$8#DI9jb1UAb}v zhX5!~MDWbS#EvA12cjr~wFb^v%H?wMrO8Q*j*L(ylR*#!AYl8=SnCjM1jzY52Fm?Z zsZ?^!2 zgzsko2($*1&0nDBG1IY$na2X z%s^DDRglCHjIkgh$`|q|6$@a;NRt#S0^t}+X=E~4m^8&|vx&9!4axcil*@ypl%i&{ ziF&<`TrMZ|dRQl9Y!rioW%zy$BHRtObx2c-IEoQP z37mD+AslGp{=5mYEsdVM!qHJP&|Cgt4Wc zA_V6IL9mI9jSg4@#XT5wmp#~Fbga@6pDFFPVU6m*eEi75zIiTC${-~e$F}9Afj$%eEF3hKQzwG8*4sJ zjY*BMFsYFwiP0MpZ@=;gaU8>>21+RuibeDf3`j1UlWaCazVD-0EXG>v_lfA^ZS8vX zyI+%E{qh&rnE5Z(m~mz|ChW*LCjdjhB;p`U5CND4U0o!Ih%i794bmFgqa;n!1~dP2 zYHI4%6P5AGzwYDRcYnPz41?b~YrkWyRpMM%-oYfoJ?GMk8$po*h(rJqXk@clWU`rM z&-32VTAw>}=FEKn@c#IRcd&o|C)hbT3;?&@c;ofogkjW9)AUEq7!q`)SJ;7_fSH9w z08vC;5CRCKHLSG@zW8UYwSTtOJ^+AY$Bsc4^5eL8(ctRUs{nxc`D-h~!^16WZ8=V& zY@8&SB#Lz$#VU>yL{Us}oRBdVX<}efn;L7|B3QC)&lqD)U$}7L=F-v<4j(>@lP6Dp zdR^a|p2p1V>~@uU_Srp^Y$o&bB#I6iW4p85a^r%BP} z>({TZ0l@V1G-iAL{;QGr)A{%Cz1NT7+O@^UFFgO;@6*&=w8l(|@Pu>R&n!7WF}pM( z(hrr=%OJfJNAdl;_wH_fZr` + + + + + + + + JdeRobot + + diff --git a/src/tools/pantilt_teleop_py/resources/resources.qrc b/src/tools/pantilt_teleop_py/resources/resources.qrc new file mode 100644 index 000000000..49295fc7b --- /dev/null +++ b/src/tools/pantilt_teleop_py/resources/resources.qrc @@ -0,0 +1,6 @@ + + + ball.png + jderobot.svg + + diff --git a/src/tools/pantilt_teleop_py/resources_rc.py b/src/tools/pantilt_teleop_py/resources_rc.py new file mode 100644 index 000000000..473c4983e --- /dev/null +++ b/src/tools/pantilt_teleop_py/resources_rc.py @@ -0,0 +1,224 @@ +# -*- coding: utf-8 -*- + +# Resource object code +# +# Created by: The Resource Compiler for PyQt5 (Qt v5.5.1) +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore + +qt_resource_data = b"\ +\x00\x00\x07\x4d\ +\x89\ +\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ +\x00\x00\x19\x00\x00\x00\x1c\x08\x06\x00\x00\x00\x94\x24\x14\xd0\ +\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\ +\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\ +\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x02\x09\ +\x11\x34\x07\x96\x4a\xc5\x0d\x00\x00\x06\xcd\x49\x44\x41\x54\x48\ +\xc7\x9d\x56\xdd\x6b\x5c\xc7\x15\xff\x9d\x99\xbb\xbb\x77\x3f\x2c\ +\x69\xb5\xbb\xfa\x8e\xd5\xae\x8d\x9b\x90\x50\xd7\x34\x36\xa9\x0a\ +\xaa\x93\x42\x5a\x1c\xda\xa6\x26\x84\x42\x1b\x30\xfd\xc0\x2d\xce\ +\x83\xdf\xfa\x37\x34\xaf\x21\x50\x3f\xf4\xa1\x06\x63\x1b\x5a\x63\ +\x28\x7d\x29\xc6\x54\xea\x83\xeb\xa6\xd4\x72\xb2\x51\x2c\x59\x76\ +\x24\xaf\xfc\x6d\xaf\xb4\xba\xab\xfb\x35\x33\xe7\xf4\x61\x57\x4a\ +\xdc\xba\x24\xf4\xc0\x70\x99\xb9\xc3\xf9\xcd\x6f\xce\x99\xdf\x39\ +\xc0\x53\x2c\x0c\x43\xfc\x3f\xd6\xe9\x74\x9e\xba\xae\x9e\xb6\x28\ +\x22\x4f\xdd\x7c\xfb\xf6\x6d\x2f\x0c\xc3\x3c\x33\xfb\x49\x92\xd0\ +\x17\x05\x7f\x62\x63\x14\x45\x20\x22\xf8\xbe\x0f\x00\x68\x36\x9b\ +\xa8\xd5\x6a\x15\x00\x35\x00\x65\x00\x03\x44\xe4\x03\x60\x11\xe9\ +\x88\xc8\x63\xe7\xdc\x63\xe7\xdc\x7a\x7f\x7f\x7f\xd0\x3b\x08\xc6\ +\xc7\xc7\x21\x22\x20\xa2\x27\x41\xc2\x30\x44\xa1\x50\xf8\x2c\x75\ +\x4d\x44\x63\x5a\xeb\xd7\x88\x68\x9a\x88\x26\x00\xf4\x01\xc8\x32\ +\xb3\x10\x51\xc8\xcc\x2d\x11\xf9\x88\x99\xff\x0a\xe0\x42\xa9\x54\ +\x0a\xb7\x6e\x82\x88\x70\xe2\xc4\x09\x1c\x3d\x7a\x14\xde\x36\x25\ +\xfa\x94\x54\x92\x24\x35\x11\x79\x4d\x44\x7e\x42\x44\xbb\x94\x52\ +\x7d\x4a\x29\x5f\x44\x3c\x11\x21\xa5\x14\x44\xc4\x69\xad\x2d\x11\ +\xed\x15\x91\x97\x8d\x31\x6f\x76\x3a\x9d\xf7\x4a\xa5\xd2\xa5\x6d\ +\x06\x5b\xdf\x24\x49\x00\x00\xb9\x5c\x0e\x00\x90\xa6\xe9\x84\xb5\ +\xf6\xfb\x00\xde\x52\x4a\xbd\xa4\x94\x82\x52\x0a\x44\x0a\x22\x0c\ +\x11\xd9\x1e\x44\xb4\xed\xc8\x18\x93\x88\xc8\x59\xad\xf5\xef\x72\ +\xb9\xdc\xdf\x88\x68\x3b\xb0\xde\x96\xf3\x1e\xcd\x42\x14\x45\x6f\ +\x32\xf3\x4f\x89\xe8\xf9\x9e\x03\x11\x11\xea\x86\x41\x20\x22\x24\ +\x22\x60\xe6\xad\xd3\x8a\x52\x0a\x5a\xeb\x5c\x9a\xa6\x6f\x05\x41\ +\x30\x7a\xea\xd4\xa9\xb7\x01\xdc\x00\xe0\x00\x40\x7f\x06\xa0\x0f\ +\xc0\xab\x51\x14\xbd\x2d\x22\x5f\x55\x4a\xfd\x47\x82\x74\x1d\x77\ +\x01\xf1\x04\xa3\xde\x4d\x50\x14\x45\xb4\xb0\xb0\xd0\x7f\xe9\xd2\ +\xa5\x6a\xb5\x5a\x5d\x5c\x5c\x5c\x7c\x04\xe0\xd3\x98\xcc\xcc\xce\ +\x7e\xb9\x5a\xa9\xfe\x60\x72\x72\xe7\xae\x52\xa9\x08\x00\xd2\xe9\ +\x74\x48\x29\x45\x4a\x2b\x11\x66\x12\x01\x20\x80\x48\x17\x44\x29\ +\x25\xcc\x42\x41\xb0\x81\x46\xa3\x21\xf3\xf3\xf3\x34\x37\x37\x57\ +\x9d\x9b\x9b\x3b\xb4\xb8\xb8\x38\x0b\x60\x15\x40\xb0\xc5\x24\xef\ +\x69\xef\x9b\xcd\xd5\xd5\x9f\x75\x3a\x41\x35\x4d\x13\x05\x08\x32\ +\x99\x2c\xb4\xd6\x24\xec\xc8\x98\x14\xec\x2c\x8c\x49\x91\x24\x31\ +\xe2\x38\x46\x1c\xc7\xd4\x6e\xb7\xb1\xbc\xfc\x09\xce\x9f\x3f\x4f\ +\x2b\x2b\x2b\xa2\x94\x22\xcf\xf3\x76\x24\x49\x72\xf7\xce\x9d\x3b\ +\xcb\x00\xee\x69\x00\x28\x16\x0b\xe3\x1f\x7d\xd8\xf8\xf6\x3f\x2e\ +\x5f\xfe\xe1\xc5\x8b\x17\xd4\xc2\xc2\x02\x44\x84\x26\x27\x77\x92\ +\xd6\x1a\x71\x1c\x22\x89\x23\xa4\x69\x82\x4e\x27\x40\xbb\xbd\x8e\ +\x76\x7b\x1d\xf7\xef\xdd\xc7\xca\xf2\x32\xae\x7e\x30\x87\xd3\xa7\ +\xcf\x60\x6a\x6a\x0a\xc7\x8f\x1f\xa7\x7d\xfb\xf6\x21\x08\x02\xd7\ +\x6e\xb7\x6f\x3d\x78\xf0\xe0\xaa\x07\x00\x26\x35\xcf\x40\xa4\x0e\ +\x02\xe2\x24\xc4\xcc\xcc\xac\x34\x1a\xf3\x74\xf6\xec\x59\xbc\xf8\ +\xe2\xd7\xb1\x77\xef\x0b\x18\x1b\x1f\x85\x73\x0e\x26\xb5\xb0\xd6\ +\xc1\x39\x06\x11\x61\x63\xa3\x8d\xf5\xb5\x35\xf8\xbe\x8f\x52\xa9\ +\x84\x4a\xa5\x82\xa1\xa1\x21\x1c\x38\x70\xe0\x39\xcf\xf3\x76\x37\ +\x1a\x0d\xf2\x7a\x19\x32\xc2\x22\x63\xce\x39\x08\x0b\x92\x74\x03\ +\xeb\xed\x0d\xdc\xb9\xbb\x8a\xd2\x8e\x02\x86\x86\x07\xa1\x33\xd4\ +\x0d\x3c\x03\x10\x82\x63\x07\x02\x41\x84\x51\xad\x0e\xca\xc4\xc4\ +\x38\x5a\xad\x16\x5d\xb9\x72\x05\xe3\xe3\xe3\x00\xd0\x5f\x2e\x97\ +\x87\x00\x28\x4f\x44\xf0\xcc\xc4\xc4\x8e\x24\x89\x07\xa2\x28\x82\ +\xb5\x06\xce\x59\xca\xe5\x72\xf2\xa5\xc9\x49\x8c\x8e\x8c\x50\x26\ +\x93\x41\x10\x04\x20\x60\xfb\xcd\x58\xeb\x10\x6c\x04\xc8\xf9\x3e\ +\x06\xca\xfd\x54\xa9\x54\x70\xf3\xe6\x0d\x9c\x3b\x77\x4e\xea\xf5\ +\x3a\x5a\xad\x16\x85\x61\xe8\x1f\x39\x72\xa4\xcb\xe4\x95\x83\x07\ +\xbd\xcd\xcd\x8e\xb7\xb6\xd6\x42\x67\x33\x40\x14\x45\x50\x4a\x63\ +\x78\x68\x08\xec\x18\x8f\x1e\x3c\x84\xef\x67\x01\x08\xb4\xf6\xa0\ +\xb5\x07\xeb\x1c\x56\x96\x6f\x21\x8e\x63\x14\x0a\x05\xb4\x5a\x8f\ +\x11\xc7\x29\x6e\xdf\xbe\x83\x99\x99\x19\xec\xd9\xb3\x07\x95\x4a\ +\x05\x87\x0e\x1d\x22\xcf\xc4\xc0\xc8\xf0\x50\x6c\xcc\x40\x54\xab\ +\x55\x90\xc4\x11\x8c\xb1\x20\x22\xca\x17\xf2\x28\x15\x0b\x60\xc7\ +\x48\x93\x14\x2c\x02\xe1\x18\x4a\x69\x64\x32\x59\x98\x34\xc5\x6a\ +\xb3\x89\xb5\xf5\x0d\xc9\xfa\x05\x94\xcb\x83\xa4\x94\xa2\x66\xb3\ +\x89\x7a\xbd\x8e\x5c\x2e\x27\xf5\x7a\x5d\x54\x36\x4f\xc8\x66\x33\ +\xad\x42\x21\xff\x68\x70\xa0\x8c\xa1\xda\x30\xc6\xc6\xc6\x64\x6c\ +\x6c\x14\x83\x83\x65\xf8\x7e\x0e\x22\xdc\x0d\xb6\x75\x48\x53\x8b\ +\x38\x8a\x11\x45\x09\x9c\x75\xd8\x68\x07\x68\x36\x9b\x94\x26\x09\ +\x65\x32\x19\xf1\xfd\x3c\x7c\xdf\x87\xe7\x79\xf0\x3c\x2f\xa8\xd7\ +\xeb\xec\x01\x00\x33\xaf\x3a\xe7\x96\x99\x19\xdd\x61\x49\x20\xf0\ +\x3c\x0f\x80\x40\x84\xb1\xa5\x9f\x22\x04\xe7\x04\x41\xb0\x89\x8d\ +\x8d\x0e\x58\x04\xc5\x42\x01\xc5\x42\x11\xe1\x66\x88\xc4\x18\xf4\ +\xf5\xf5\xc1\x39\xb7\x12\x86\x61\xb3\x5c\x2e\x77\x41\x04\x74\xd7\ +\x32\xdf\x60\xe1\x8e\xb0\x2d\x49\x37\x85\x60\x4c\xda\x03\x71\x60\ +\xb6\x3d\x91\x24\x30\x0b\x2c\x3b\x14\x8a\x79\x4c\x4e\xee\xc4\xd8\ +\xd8\x28\x32\x7e\x11\xcc\x40\xa9\x27\xb6\xf9\x7c\x7e\xce\x39\xd7\ +\x20\xa2\x6e\x65\x7c\xf9\x95\x1f\x3f\x34\xce\xcd\x1b\x6b\x3e\x4e\ +\x8d\x49\x8d\xb1\x30\xa9\x91\x24\x89\xd1\x1b\x12\x6f\xbf\xf2\x08\ +\x71\x1c\xc3\xa4\x06\x4a\x29\x14\x8a\x45\xf4\x0f\x0c\x48\x2e\x9b\ +\x93\x6c\x36\x43\xbe\xef\xa3\x58\x2c\xc6\x5a\xeb\xf7\x89\xe8\xe3\ +\x6d\xed\x7a\xf5\xbb\x5f\x93\x5f\xfd\xf2\x17\xd7\x98\xf9\x2f\xd6\ +\x98\x71\x66\x37\x26\xec\xc8\x39\x27\x00\x43\xc0\x24\xe2\x20\x4c\ +\x10\x01\x98\x05\x5d\x5d\x24\x88\x88\x30\x40\x10\x0d\xd2\x1a\xda\ +\xa3\x24\x4d\xd3\x06\x33\xff\x73\x6a\x6a\xea\xd6\x13\x95\xf1\xca\ +\xbf\xee\xe3\xdd\x77\x7f\xbd\x33\x0c\x83\xdf\x3a\x6b\xbf\x63\xad\ +\x55\xe2\x5c\x57\xde\xc1\x24\xc2\x3d\xe7\xd2\x8b\x1b\x41\x91\x02\ +\x88\x44\x00\x12\x68\x64\xb3\x59\x64\xb2\x99\x65\xcf\xf3\xde\xd1\ +\x5a\x9f\x3b\x73\xe6\xcc\x7d\x00\xf0\xfe\xf8\x87\x77\xb0\x7f\xff\ +\x27\xd8\x39\x39\x0c\x00\xb7\xde\x78\xe3\xf5\xdf\x84\x61\xd4\x4e\ +\xd3\xf4\x47\xce\x18\x12\x74\xa5\x57\xd8\x81\x9d\x80\x99\x85\x45\ +\x00\x51\x44\x5d\x10\x02\x08\xa4\x35\xac\xb5\x0b\xbe\xf8\x67\xad\ +\xb5\x7f\xb6\xd6\x3e\x00\x80\x63\xc7\x8e\x41\x17\xf2\xe3\xb8\x78\ +\xd1\xe0\xea\xd5\xab\x00\x80\xf9\xf9\x6b\x2b\xc3\xc3\xc3\x2d\x6b\ +\x6d\x39\x4e\xa2\x6c\x9c\x24\x99\x24\x8a\x75\x1c\xc5\x2a\x8e\x13\ +\x44\x51\x4c\x71\x9c\x90\x31\x16\x69\x62\x60\x52\x9b\x1a\x6b\xdb\ +\x22\x58\xb2\x6c\xcf\x18\x63\x4e\x5f\xb8\x70\xe1\xe6\xd2\xd2\x12\ +\x0e\x1f\x3e\x8c\x93\x27\x4f\x7e\x7a\x5d\xdf\x9a\x9e\xc6\xcc\xec\ +\xec\x76\x95\x7a\xf6\xd9\x3d\x95\x6c\x26\xf3\xf3\x24\x8a\x0e\x1a\ +\x63\xbe\x22\xcc\x35\x11\x14\x9c\x63\x25\x22\xf0\xbc\xac\x23\xa8\ +\x35\x90\x5a\xd5\x9e\xfa\x00\x0a\xa7\x49\xd1\xe5\xeb\xd7\xaf\xaf\ +\x01\xc0\xf4\xf4\x34\x66\x7b\xfe\xfe\xab\x91\xf8\xd3\xf9\xf7\xf0\ +\xbd\xd7\x8f\xe1\xda\xb5\xc5\xc7\x2f\x3c\xff\xdc\xef\xd3\xd4\x5c\ +\xb4\xc6\x4c\x8a\xf0\x84\x73\xdc\xcf\x2c\x39\x40\x31\xbb\x34\x22\ +\xd2\x0f\x95\xd2\xcb\x20\xbd\x14\x47\xf1\xfd\xbb\xf7\xee\x6e\x7e\ +\x6e\xdf\xb5\x65\xdf\x78\x69\x3f\x2e\xfd\xfd\xfd\xed\x79\xce\xcb\ +\xe6\x8b\x05\x7f\x80\xd9\xe6\x01\x9d\x21\xd2\xc2\x4e\x12\x02\x75\ +\xd6\xc3\xf5\x35\x00\xbc\xb5\x77\xf7\xae\xdd\x20\x22\x5c\x5f\xba\ +\xfe\xf9\x5d\xdf\x48\xad\x86\x91\x5a\xed\x0b\x75\x88\xa3\xd5\x51\ +\x8c\x56\x47\xff\xe7\xff\x7f\x03\x97\x54\x18\xa6\xd8\x35\x20\x89\ +\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ +\x00\x00\x03\xc6\ +\x3c\ +\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\ +\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\ +\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\ +\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\ +\x73\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\ +\x33\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x30\x2f\ +\x2f\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\ +\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x54\x52\x2f\x32\x30\x30\x31\x2f\ +\x50\x52\x2d\x53\x56\x47\x2d\x32\x30\x30\x31\x30\x37\x31\x39\x2f\ +\x44\x54\x44\x2f\x73\x76\x67\x31\x30\x2e\x64\x74\x64\x22\x3e\x0a\ +\x3c\x73\x76\x67\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x33\x63\x6d\ +\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x35\x63\x6d\x22\x20\ +\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x37\x39\x20\x37\x39\x20\x32\ +\x34\x33\x20\x32\x39\x35\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\ +\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\ +\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\ +\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\ +\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\ +\x6c\x69\x6e\x6b\x22\x3e\x0a\x20\x20\x3c\x65\x6c\x6c\x69\x70\x73\ +\x65\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x20\x6e\ +\x6f\x6e\x65\x3b\x20\x66\x69\x6c\x6c\x2d\x6f\x70\x61\x63\x69\x74\ +\x79\x3a\x30\x3b\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\ +\x68\x3a\x20\x38\x3b\x20\x73\x74\x72\x6f\x6b\x65\x3a\x20\x23\x66\ +\x66\x61\x35\x30\x30\x22\x20\x63\x78\x3d\x22\x31\x38\x34\x22\x20\ +\x63\x79\x3d\x22\x32\x31\x38\x22\x20\x72\x78\x3d\x22\x38\x37\x22\ +\x20\x72\x79\x3d\x22\x38\x34\x22\x2f\x3e\x0a\x20\x20\x3c\x65\x6c\ +\x6c\x69\x70\x73\x65\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\ +\x6c\x3a\x20\x6e\x6f\x6e\x65\x3b\x20\x66\x69\x6c\x6c\x2d\x6f\x70\ +\x61\x63\x69\x74\x79\x3a\x30\x3b\x20\x73\x74\x72\x6f\x6b\x65\x2d\ +\x77\x69\x64\x74\x68\x3a\x20\x38\x3b\x20\x73\x74\x72\x6f\x6b\x65\ +\x3a\x20\x23\x30\x38\x39\x31\x66\x38\x22\x20\x63\x78\x3d\x22\x31\ +\x36\x35\x22\x20\x63\x79\x3d\x22\x32\x33\x33\x22\x20\x72\x78\x3d\ +\x22\x35\x34\x22\x20\x72\x79\x3d\x22\x35\x34\x22\x2f\x3e\x0a\x20\ +\x20\x3c\x65\x6c\x6c\x69\x70\x73\x65\x20\x73\x74\x79\x6c\x65\x3d\ +\x22\x66\x69\x6c\x6c\x3a\x20\x6e\x6f\x6e\x65\x3b\x20\x66\x69\x6c\ +\x6c\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x30\x3b\x20\x73\x74\x72\ +\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x20\x38\x3b\x20\x73\x74\ +\x72\x6f\x6b\x65\x3a\x20\x23\x66\x66\x30\x30\x30\x30\x22\x20\x63\ +\x78\x3d\x22\x32\x30\x31\x22\x20\x63\x79\x3d\x22\x32\x30\x31\x22\ +\x20\x72\x78\x3d\x22\x31\x31\x37\x22\x20\x72\x79\x3d\x22\x31\x31\ +\x37\x22\x2f\x3e\x0a\x20\x20\x3c\x65\x6c\x6c\x69\x70\x73\x65\x20\ +\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x20\x6e\x6f\x6e\ +\x65\x3b\x20\x66\x69\x6c\x6c\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\ +\x30\x3b\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\ +\x20\x38\x3b\x20\x73\x74\x72\x6f\x6b\x65\x3a\x20\x23\x30\x62\x62\ +\x64\x30\x62\x22\x20\x63\x78\x3d\x22\x31\x35\x32\x22\x20\x63\x79\ +\x3d\x22\x32\x34\x35\x22\x20\x72\x78\x3d\x22\x32\x39\x22\x20\x72\ +\x79\x3d\x22\x32\x39\x22\x2f\x3e\x0a\x20\x20\x3c\x74\x65\x78\x74\ +\x20\x66\x6f\x6e\x74\x2d\x73\x69\x7a\x65\x3d\x22\x33\x39\x2e\x34\ +\x39\x39\x38\x22\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\ +\x3a\x20\x23\x30\x37\x32\x35\x39\x33\x3b\x74\x65\x78\x74\x2d\x61\ +\x6e\x63\x68\x6f\x72\x3a\x6d\x69\x64\x64\x6c\x65\x3b\x66\x6f\x6e\ +\x74\x2d\x66\x61\x6d\x69\x6c\x79\x3a\x73\x61\x6e\x73\x2d\x73\x65\ +\x72\x69\x66\x3b\x66\x6f\x6e\x74\x2d\x73\x74\x79\x6c\x65\x3a\x6e\ +\x6f\x72\x6d\x61\x6c\x3b\x66\x6f\x6e\x74\x2d\x77\x65\x69\x67\x68\ +\x74\x3a\x37\x30\x30\x22\x20\x78\x3d\x22\x32\x30\x35\x22\x20\x79\ +\x3d\x22\x33\x36\x35\x22\x3e\x0a\x20\x20\x20\x20\x3c\x74\x73\x70\ +\x61\x6e\x20\x78\x3d\x22\x32\x30\x35\x22\x20\x79\x3d\x22\x33\x36\ +\x35\x22\x3e\x4a\x64\x65\x52\x6f\x62\x6f\x74\x3c\x2f\x74\x73\x70\ +\x61\x6e\x3e\x0a\x20\x20\x3c\x2f\x74\x65\x78\x74\x3e\x0a\x3c\x2f\ +\x73\x76\x67\x3e\x0a\ +" + +qt_resource_name = b"\ +\x00\x06\ +\x07\x03\x7d\xc3\ +\x00\x69\ +\x00\x6d\x00\x61\x00\x67\x00\x65\x00\x73\ +\x00\x08\ +\x08\x2f\x5a\x47\ +\x00\x62\ +\x00\x61\x00\x6c\x00\x6c\x00\x2e\x00\x70\x00\x6e\x00\x67\ +\x00\x0c\ +\x07\x72\xc8\x67\ +\x00\x6a\ +\x00\x64\x00\x65\x00\x72\x00\x6f\x00\x62\x00\x6f\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\ +" + +qt_resource_struct = b"\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\ +\x00\x00\x00\x28\x00\x00\x00\x00\x00\x01\x00\x00\x07\x51\ +\x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +" + +def qInitResources(): + QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + +def qCleanupResources(): + QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + +qInitResources() From 8e0c7ddd33a5904802514c14915064193939f4d8 Mon Sep 17 00:00:00 2001 From: Aitor Martinez Date: Wed, 28 Jun 2017 08:27:56 +0200 Subject: [PATCH 2/2] [issue #821] solved Error in ptmotors of parallelIce_py --- src/libs/parallelIce_py/parallelIce/ptMotors.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/parallelIce_py/parallelIce/ptMotors.py b/src/libs/parallelIce_py/parallelIce/ptMotors.py index f50e33405..de1e6b85e 100644 --- a/src/libs/parallelIce_py/parallelIce/ptMotors.py +++ b/src/libs/parallelIce_py/parallelIce/ptMotors.py @@ -46,11 +46,11 @@ def __init__(self, ic, prefix): self.params = self.proxy.getPTMotorsParams() print ("+++ MAX/MIN Pan/Tilt Values +++") - print ("+ Min Pan: " + str(self.params.minPan) + "º +") - print ("+ Max Pan: " + str(self.params.maxPan) + "º +") + print ("+ Min Pan: " + str(self.params.minPan) + " +") + print ("+ Max Pan: " + str(self.params.maxPan) + " +") print ("+ Max Pan speed: " + str(self.params.maxPanSpeed) + " +") - print ("+ Min Tilt: " + str(self.params.minTilt) + "º +") - print ("+ Max Tilt: " + str(self.params.maxTilt) + "º +") + print ("+ Min Tilt: " + str(self.params.minTilt) + " +") + print ("+ Max Tilt: " + str(self.params.maxTilt) + " +") print ("+ Max Tilt speed: " + str(self.params.maxTiltSpeed) + " +") print ("++++++++++++++++++++++++++++++") @@ -120,4 +120,4 @@ def hasproxy(): return self.motors.hasproxy() def setPTMotorsData(self, pan, tilt, panspeed, tiltspeed): - self.motors.setPTMotorsData(pan, tilt, panspeed, tiltspeed) \ No newline at end of file + self.motors.setPTMotorsData(pan, tilt, panspeed, tiltspeed)