Beispiel #1
0
    def setupUi(self):

        self.objectTree = QtGui.QTreeWidget()
        self.propertiesPanel = PythonQt.dd.ddPropertiesPanel()

        sidePanel = QtGui.QSplitter(QtCore.Qt.Vertical)
        sidePanel.addWidget(self.objectTree)
        sidePanel.addWidget(self.propertiesPanel)
        sidePanel.setSizes([6, 4])

        om.init(self.objectTree, self.propertiesPanel)

        self.view = PythonQt.dd.ddQVTKWidgetView()
        lcmgl.init(self.view)

        self.view.backgroundRenderer().SetBackground(1,1,1)
        self.view.backgroundRenderer().SetBackground2(1,1,1)

        def setTextProperty(caption):
          prop = caption.GetCaptionTextProperty()
          prop.ShadowOff()
          prop.BoldOn()
          prop.ItalicOff()
          prop.SetColor(0,0,0)

        axesActor = self.view.orientationMarkerWidget().GetOrientationMarker()
        setTextProperty(axesActor.GetXAxisCaptionActor2D())
        setTextProperty(axesActor.GetYAxisCaptionActor2D())
        setTextProperty(axesActor.GetZAxisCaptionActor2D())

        w = QtGui.QWidget()
        l = QtGui.QHBoxLayout(w)
        self.slider = QtGui.QSlider(QtCore.Qt.Horizontal)
        self.clearButton = QtGui.QPushButton('clear')
        self.zeroButton = QtGui.QPushButton('zero')

        l.addWidget(self.clearButton)
        l.addWidget(self.zeroButton)
        l.addWidget(self.slider)

        self.slider.connect(self.slider, 'valueChanged(int)', self.onSlider)
        self.slider.connect(self.zeroButton, 'clicked()', self.onZeroButtonClicked)
        self.slider.connect(self.clearButton, 'clicked()', self.onClearButtonClicked)

        ww = QtGui.QWidget()
        ll = QtGui.QVBoxLayout(ww)
        ll.addWidget(self.view)
        #ll.addWidget(w)
        ll.setMargin(0)

        splitter = QtGui.QSplitter()
        splitter.addWidget(sidePanel)
        splitter.addWidget(ww)
        splitter.setSizes([0, 1])

        splitter.show()
        splitter.resize(800, 600)
        self.widget = splitter
        self.widget.setWindowTitle('Drake Viewer')
Beispiel #2
0

viewBackgroundLightHandler = ViewBackgroundLightHandler(viewOptions, grid)
if not useLightColorScheme:
    viewBackgroundLightHandler.action.trigger()

if useHands:
    handcontrolpanel.init(lHandDriver, rHandDriver, robotStateModel, robotStateJointController, view)


if useFootsteps:
    footstepsPanel = footstepsdriverpanel.init(footstepsDriver, robotStateModel, robotStateJointController, irisDriver)


if useLCMGL:
    lcmglManager = lcmgl.init(view)
    app.MenuActionToggleHelper('Tools', 'Renderer - LCM GL', lcmglManager.isEnabled, lcmglManager.setEnabled)

if useDrakeVisualizer:
    drakeVisualizer = drakevisualizer.DrakeVisualizer(view)
    app.MenuActionToggleHelper('Tools', 'Renderer - Drake', drakeVisualizer.isEnabled, drakeVisualizer.setEnabled)


if useNavigationPanel:
    navigationPanel = navigationpanel.init(robotStateJointController, footstepsDriver)
    picker = PointPicker(view, callback=navigationPanel.pointPickerStoredFootsteps, numberOfPoints=2)
    #picker.start()


if usePlanning:
Beispiel #3
0
    def setupUi(self):

        self.objectTree = QtGui.QTreeWidget()
        self.propertiesPanel = PythonQt.dd.ddPropertiesPanel()

        sidePanel = QtGui.QSplitter(QtCore.Qt.Vertical)
        sidePanel.addWidget(self.objectTree)
        sidePanel.addWidget(self.propertiesPanel)
        sidePanel.setSizes([6, 4])

        om.init(self.objectTree, self.propertiesPanel)

        self.view = PythonQt.dd.ddQVTKWidgetView()
        lcmgl.init(self.view)

        self.view.backgroundRenderer().SetBackground(1, 1, 1)
        self.view.backgroundRenderer().SetBackground2(1, 1, 1)

        def setTextProperty(caption):
            prop = caption.GetCaptionTextProperty()
            prop.ShadowOff()
            prop.BoldOn()
            prop.ItalicOff()
            prop.SetColor(0, 0, 0)

        axesActor = self.view.orientationMarkerWidget().GetOrientationMarker()
        setTextProperty(axesActor.GetXAxisCaptionActor2D())
        setTextProperty(axesActor.GetYAxisCaptionActor2D())
        setTextProperty(axesActor.GetZAxisCaptionActor2D())

        w = QtGui.QWidget()
        l = QtGui.QHBoxLayout(w)
        self.slider = QtGui.QSlider(QtCore.Qt.Horizontal)
        self.clearButton = QtGui.QPushButton('clear')
        self.zeroButton = QtGui.QPushButton('zero')

        l.addWidget(self.clearButton)
        l.addWidget(self.zeroButton)
        l.addWidget(self.slider)

        self.slider.connect(self.slider, 'valueChanged(int)', self.onSlider)
        self.slider.connect(self.zeroButton, 'clicked()',
                            self.onZeroButtonClicked)
        self.slider.connect(self.clearButton, 'clicked()',
                            self.onClearButtonClicked)

        ww = QtGui.QWidget()
        ll = QtGui.QVBoxLayout(ww)
        ll.addWidget(self.view)
        #ll.addWidget(w)
        ll.setMargin(0)

        splitter = QtGui.QSplitter()
        splitter.addWidget(sidePanel)
        splitter.addWidget(ww)
        splitter.setSizes([0, 1])

        splitter.show()
        splitter.resize(800, 600)
        self.widget = splitter
        self.widget.setWindowTitle('Drake Viewer')