Example #1
0
        if not self.polyDataObj.initialized:
            self.polyDataObj.initialized = True


def init(view):
    global PointCloudQueue, _pointcloudItem, _pointcloudSource
    PointCloudQueue = PythonQt.dd.ddPointCloudLCM(
        lcmUtils.getGlobalLCMThread())
    PointCloudQueue.init(lcmUtils.getGlobalLCMThread(),
                         drcargs.args().config_file)

    _pointcloudSource = PointCloudSource(view, PointCloudQueue)
    _pointcloudSource.start()

    sensorsFolder = om.getOrCreateContainer('sensors')

    _pointcloudItem = PointCloudItem(_pointcloudSource)
    om.addToObjectModel(_pointcloudItem, sensorsFolder)


def startButton():
    view = app.getCurrentRenderView()
    init(view)
    _pointcloudSource.start()


try:
    app.addToolbarMacro('start live pointcloud', startButton)
except AttributeError:
    pass
        p = filterUtils.transformPolyData(p,sensorToLocalFused)
        self.polyDataObj.setPolyData(p)

        if not self.polyDataObj.initialized:
            self.polyDataObj.initialized = True


def init(view):
    global PointCloudQueue, _pointcloudItem, _pointcloudSource
    PointCloudQueue = PythonQt.dd.ddPointCloudLCM(lcmUtils.getGlobalLCMThread())
    PointCloudQueue.init(lcmUtils.getGlobalLCMThread(), drcargs.args().config_file)
    
    _pointcloudSource = PointCloudSource(view, PointCloudQueue)
    _pointcloudSource.start()

    sensorsFolder = om.getOrCreateContainer('sensors')

    _pointcloudItem = PointCloudItem(_pointcloudSource)
    om.addToObjectModel(_pointcloudItem, sensorsFolder)
    

def startButton():
    view = app.getCurrentRenderView()
    init(view)
    _pointcloudSource.start()

try:
    app.addToolbarMacro('start live pointcloud', startButton)
except AttributeError:
    pass
Example #3
0
    slider.setMaximumWidth(200)
    slider.connect('valueChanged(int)', onDrillYawSliderChanged)

    app.getMainWindow().macrosToolBar().addWidget(slider)


    def sendPointerPrep():
         drillDemo.planPointerPressGaze(-0.05)

    def sendPointerPress():
         drillDemo.planPointerPressGaze(0.01)

    def sendPointerPressDeep():
         drillDemo.planPointerPressGaze(0.015)

    app.addToolbarMacro('drill posture', drillDemo.planBothRaisePowerOn)
    app.addToolbarMacro('pointer prep', sendPointerPrep)
    app.addToolbarMacro('pointer press', sendPointerPress)
    app.addToolbarMacro('pointer press deep', sendPointerPressDeep)


import signal
def sendMatlabSigint():
    ikServer.comm.client.proc.send_signal(signal.SIGINT)


#app.addToolbarMacro('Ctrl+C MATLAB', sendMatlabSigint)

class AffordanceTextureUpdater(object):

    def __init__(self, affordanceManager):
Example #4
0
    slider.setValue(180)
    slider.setMaximumWidth(200)
    slider.connect('valueChanged(int)', onDrillYawSliderChanged)

    app.getMainWindow().macrosToolBar().addWidget(slider)

    def sendPointerPrep():
        drillDemo.planPointerPressGaze(-0.05)

    def sendPointerPress():
        drillDemo.planPointerPressGaze(0.01)

    def sendPointerPressDeep():
        drillDemo.planPointerPressGaze(0.015)

    app.addToolbarMacro('drill posture', drillDemo.planBothRaisePowerOn)
    app.addToolbarMacro('pointer prep', sendPointerPrep)
    app.addToolbarMacro('pointer press', sendPointerPress)
    app.addToolbarMacro('pointer press deep', sendPointerPressDeep)

import signal


def sendMatlabSigint():
    ikServer.comm.client.proc.send_signal(signal.SIGINT)


#app.addToolbarMacro('Ctrl+C MATLAB', sendMatlabSigint)


class AffordanceTextureUpdater(object):
Example #5
0
    _kinectSource = KinectSource(view, KinectQueue)
    _kinectSource.start()

    sensorsFolder = om.getOrCreateContainer('sensors')

    _kinectItem = KinectItem(_kinectSource)
    om.addToObjectModel(_kinectItem, sensorsFolder)


# Hasn't been used - currently deactivated
#def renderLastKinectPointCloud():
#    # view = view or app.getCurrentRenderView()
#    # if view is None:
#    #     return
#    p = vtk.vtkPolyData()
#    print("will grab the last point cloud in python \n")
#    KinectQueue.getPointCloudFromKinect(p)
#    print("grabbed the last point cloud in python, will #render now \n")
#    obj = vis.showPolyData (p, 'kinect cloud')
#    print("director rendered last point cloud \n")


def startButton():
    view = app.getCurrentRenderView()
    init(view)
    _kinectSource.start()


app.addToolbarMacro('start live kinect', startButton)
Example #6
0
    KinectQueue.init(lcmUtils.getGlobalLCMThread(), drcargs.args().config_file)
    
    _kinectSource = KinectSource(view, KinectQueue)
    _kinectSource.start()

    sensorsFolder = om.getOrCreateContainer('sensors')

    _kinectItem = KinectItem(_kinectSource)
    om.addToObjectModel(_kinectItem, sensorsFolder)
    

# Hasn't been used - currently deactivated
#def renderLastKinectPointCloud():
#    # view = view or app.getCurrentRenderView()
#    # if view is None:
#    #     return
#    p = vtk.vtkPolyData()
#    print("will grab the last point cloud in python \n")
#    KinectQueue.getPointCloudFromKinect(p)
#    print("grabbed the last point cloud in python, will #render now \n")
#    obj = vis.showPolyData (p, 'kinect cloud')
#    print("director rendered last point cloud \n")


def startButton():
    view = app.getCurrentRenderView()
    init(view)
    _kinectSource.start()

app.addToolbarMacro('start live kinect', startButton)
Example #7
0
def setupToolbarButtons():
    applogic.addToolbarMacro('left arm', reachWithLeft)
    applogic.addToolbarMacro('right arm', reachWithRight)
def setupToolbarButtons():
    applogic.addToolbarMacro('left arm', reachWithLeft)
    applogic.addToolbarMacro('right arm', reachWithRight)