コード例 #1
0
ファイル: gestures.py プロジェクト: hsab/BlenderBQ
 def __init__(self):
     self.grabbing_hands = {}
     self.first_hand_closed = MixedFilter([
         #NoiseFilter(2, 100, 20),
         LowpassFilter(0.1)
     ])
     self.second_hand_closed = MixedFilter([
         #NoiseFilter(2, 100, 20),
         LowpassFilter(0.1)
     ])
コード例 #2
0
ファイル: __init__.py プロジェクト: hsab/BlenderBQ
 def __init__(self):
     super(ObjectController, self).__init__()
     self.nb_hands = MixedFilter(
         [NoiseFilter(10, 0.3, 10),
          LowpassFilter(0.5)])
     self.grab = GrabLogic()
     self.scale = ScaleLogic()
コード例 #3
0
ファイル: __init__.py プロジェクト: hsab/BlenderBQ
 def __init__(self):
     self.is_activated = False
     self.two_hands_grabbing = gestures.TwoHandsGrabbing()
     self.magnitude = MixedFilter([
         #NoiseFilter(1000, 100, 20),
         LowpassFilter(0.05)
     ])
     self.magnitude_origin = 0
コード例 #4
0
ファイル: __init__.py プロジェクト: hsab/BlenderBQ
    def __init__(self):
        self.grabbing_hand = gestures.GrabbingHand()
        self.is_activated = False

        # hand location
        self.loc_x_hand = MixedFilter(
            [NoiseFilter(1000, 100, 20),
             LowpassFilter(0.05)])
        self.loc_y_hand = MixedFilter(
            [NoiseFilter(1000, 100, 20),
             LowpassFilter(0.05)])
        self.loc_z_hand = MixedFilter(
            [NoiseFilter(1000, 100, 20),
             LowpassFilter(0.05)])

        self.loc_x_origin = 0
        self.loc_y_origin = 0
        self.loc_z_origin = 0

        # hand rotation
        self.rot_x_hand = MixedFilter(
            [NoiseFilter(1000, 100, 20),
             LowpassFilter(0.05)])
        self.rot_y_hand = MixedFilter(
            [NoiseFilter(1000, 100, 20),
             LowpassFilter(0.05)])
        self.rot_z_hand = MixedFilter(
            [NoiseFilter(1000, 100, 20),
             LowpassFilter(0.05)])

        self.rot_x_origin = 0
        self.rot_y_origin = 0
        self.rot_z_origin = 0
コード例 #5
0
    def initialize(self):

        # Set default log file
        self.userHome = os.getenv('USERPROFILE')
        if self.userHome is None:
            self.userHome = os.getenv('HOME')
        self.defaultLogPath = os.path.join(self.userHome, DEFAULT_LOG_FILE)
        self.logPath = self.defaultLogPath
        self.logFileLabel.setText('Log File: %s' % (self.logPath))

        # Set last directory
        self.lastDir = self.userHome

        # Set default com port
        osType = platform.system()
        if osType == 'Linux':
            self.port = '/dev/ttyUSB1'
        else:
            self.port = 'com1'
        self.serialPortEdit.setText(self.port)

        # Setup list view
        self.horizontalHeaderLabels = ['Sample #', 'Freq (Hz)', 'Value (pF)']
        self.numSensors = 4
        self.tableWidget.setRowCount(self.numSensors)
        self.tableWidget.setColumnCount(len(self.horizontalHeaderLabels))
        self.tableWidget.setHorizontalHeaderLabels(self.horizontalHeaderLabels)
        self.sensorLabels = []
        for i in range(0, self.numSensors):
            self.sensorLabels.append('Sensor %d' % (i, ))
        self.tableWidget.setVerticalHeaderLabels(self.sensorLabels)

        # Create table items
        self.tableItem = {}
        for i in range(0, self.numSensors):
            for j in range(0, len(self.horizontalHeaderLabels)):
                self.tableItem[(i, j)] = QtGui.QTableWidgetItem()
                self.tableWidget.setItem(i, j, self.tableItem[(i, j)])

        # Set up sensor object
        self.sensor = None
        self.logger = None

        # Setup time information
        self.firstTime = None

        # Setup frequency data
        self.lastSampleTime = {}
        self.freqFilter = {}
        for i in range(0, self.numSensors):
            self.freqFilter[i] = LowpassFilter(fc=1.5)

        # List of widgets to disable during a run
        self.stopEnabledList = [
            'startPushButton', 'filePushButton', 'serialPortEdit'
        ]
        self.stopDisabledList = ['stopPushButton']

        self.runEnabledList = [
            'stopPushButton',
        ]
        self.runDisabledList = [
            'startPushButton', 'filePushButton', 'serialPortEdit'
        ]

        self.initDisabledList = ['filePushButton', 'serialPortEdit']

        # Initialize state infromation
        self.running = False
        self.stateLabel.setText('Stopped')
        self.setEnabledForState('Stopped')
コード例 #6
0
ファイル: gestures.py プロジェクト: hsab/BlenderBQ
 def __init__(self):
     self.nb_fingers = MixedFilter(
         [NoiseFilter(100, 0.3, 10),
          LowpassFilter(0.9)])