コード例 #1
0
import os
import pydot

import rospy
import rospkg
from std_msgs.msg import String
# for resizing graph we use functionality from rqt_graph
from rqt_graph.interactive_graphics_view import InteractiveGraphicsView

# common imports that work for both versions PyQt4 and PyQt5
from python_qt_binding import loadUi, QT_BINDING_VERSION
from python_qt_binding.QtCore import QByteArray
from python_qt_binding.QtSvg import QGraphicsSvgItem

# check user Qt version and import libraries accordingly
if QT_BINDING_VERSION.startswith('4'):
    from python_qt_binding.QtGui import QWidget, QGraphicsScene
    from python_qt_binding.QtSvg import QSvgRenderer
    from python_qt_binding.QtWebKit import QGraphicsWebView
elif QT_BINDING_VERSION.startswith('5'):
    from PyQt5.QtWidgets import QWidget
    from PyQt5.QtWebKitWidgets import QGraphicsWebView
    from PyQt5.QtWidgets import QGraphicsScene
    from PyQt5.QtSvg import QSvgRenderer
    from PyQt5.QtWidgets import QFileDialog
else:
    rospy.logerr('Unsupported Qt version, (supported are : PyQt4, PyQt5)')


class EsterelPlanViewerWidget(QWidget):
コード例 #2
0
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from python_qt_binding import QT_BINDING, QT_BINDING_VERSION

try:
    from pkg_resources import parse_version
except:
    import re

    def parse_version(s):
        return [int(x) for x in re.sub(r'(\.0+)*$', '', s).split('.')]

if QT_BINDING == 'pyside':
    qt_binding_version = QT_BINDING_VERSION.replace('~', '-')
    if parse_version(qt_binding_version) <= parse_version('1.1.2'):
        raise ImportError('A PySide version newer than 1.1.0 is required.')

from python_qt_binding.QtCore import Slot, Qt, qVersion, qWarning, Signal
from python_qt_binding.QtGui import QColor
from python_qt_binding.QtWidgets import QWidget, QVBoxLayout, QSizePolicy

import operator
import matplotlib
if qVersion().startswith('5.'):
    if QT_BINDING == 'pyside':
        if parse_version(matplotlib.__version__) < parse_version('2.1.0'):
            raise ImportError('A newer matplotlib is required (at least 2.1.0 for PySide 2)')
    if parse_version(matplotlib.__version__) < parse_version('1.4.0'):
        raise ImportError('A newer matplotlib is required (at least 1.4.0 for Qt 5)')
コード例 #3
0
import os
import rospy
import rospkg
import tf
import math
import types
import functools

from qt_gui.plugin import Plugin
from python_qt_binding import loadUi
from python_qt_binding.QtCore import Qt, QPointF, QRectF
from python_qt_binding import QT_BINDING_VERSION
from python_qt_binding.QtGui import QPainter, QPen, QColor, QTextOption
from python_qt_binding.QtGui import QMouseEvent
g_PYQT_MAJOR_VERSION = int(QT_BINDING_VERSION.split('.')[0])
if g_PYQT_MAJOR_VERSION == 4:
    from python_qt_binding.QtGui import QWidget
elif g_PYQT_MAJOR_VERSION == 5:
    from python_qt_binding.QtWidgets import QWidget

from nav_msgs.msg import Odometry
from std_msgs.msg import UInt16MultiArray as UIntArray
from std_msgs.msg import String
from geometry_msgs.msg import PoseStamped, TwistStamped
from geometry_msgs.msg import Point
from consai_msgs.msg import GeometryFieldSize, FieldLineSegment, FieldCircularArc
from consai_msgs.msg import ReplaceBall, ReplaceRobot
from aisaac.msg import Status

from geometry import Geometry
コード例 #4
0
ファイル: mat_data_plot.py プロジェクト: mvieth/rqt_plot
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from python_qt_binding import QT_BINDING, QT_BINDING_VERSION

try:
    from pkg_resources import parse_version
except:
    import re

    def parse_version(s):
        return [int(x) for x in re.sub(r'(\.0+)*$', '', s).split('.')]


if QT_BINDING == 'pyside':
    qt_binding_version = QT_BINDING_VERSION.replace('~', '-')
    if parse_version(qt_binding_version) <= parse_version('1.1.2'):
        raise ImportError('A PySide version newer than 1.1.0 is required.')

from python_qt_binding.QtCore import Slot, Qt, qVersion, qWarning, Signal
from python_qt_binding.QtGui import QColor
from python_qt_binding.QtWidgets import QWidget, QVBoxLayout, QSizePolicy

import operator
import matplotlib
if qVersion().startswith('5.'):
    if QT_BINDING == 'pyside':
        if parse_version(matplotlib.__version__) < parse_version('2.1.0'):
            raise ImportError(
                'A newer matplotlib is required (at least 2.1.0 for PySide 2)')
    if parse_version(matplotlib.__version__) < parse_version('1.4.0'):
コード例 #5
0
import rospy
import rospkg
import sys

from itertools import product
from string import join, split

from std_msgs.msg import *
from diagnostic_msgs.msg import KeyValue
from rosplan_dispatch_msgs.msg import *
from rosplan_knowledge_msgs.srv import *
from rosplan_knowledge_msgs.msg import *

from python_qt_binding import loadUi, QT_BINDING_VERSION
from python_qt_binding.QtCore import Qt, QTimer, QUrl, Signal, Slot, pyqtSignal
if QT_BINDING_VERSION.startswith('4'):
    from python_qt_binding.QtGui import  QWidget
else:
    from python_qt_binding.QtWidgets import QWidget

class ProblemViewerWidget(QWidget):

    _problem_text = ""
    _update_signal = pyqtSignal()

    def __init__(self, plugin=None):
        super(ProblemViewerWidget, self).__init__()

        # Create QWidget
        ui_file = os.path.join(rospkg.RosPack().get_path('rosplan_rqt'), 'resource', 'problem_viewer.ui')
        loadUi(ui_file, self)
コード例 #6
0
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

# System imports
from python_qt_binding import QT_BINDING_VERSION
if float(QT_BINDING_VERSION.split(".")[0]) < 5:
    # for retrocompatibility
    from python_qt_binding.QtGui import QVBoxLayout, QWidget
else:
    # for compatibility with pyqt5 or higher
    from python_qt_binding.QtWidgets import QVBoxLayout, QWidget

from qt_gui.plugin import Plugin
from qt_gui_py_common.simple_settings_dialog import SimpleSettingsDialog

# Local imports
#from .utils import _build_common_widget
from .dg_button import DynamicGraphButton
from .py_console_widget import PyConsoleWidget
try:
    from .spyder_console_widget import SpyderConsoleWidget