aboutsummaryrefslogtreecommitdiff
path: root/behaviors/MobileShakeBehavior.py
blob: b05cb5f99b90c1e3a01dfb95983d6362aa98a65d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from operationscore.Behavior import *
import util.ComponentRegistry as compReg
import util.Strings as Strings

class MobileShakeBehavior(Behavior):
    def behaviorInit(self):
        self.mapper = None
        
    def processResponse(self, sensorInputs, recursiveInputs):
        if self.mapper == None:
            try:
                self.mapper = compReg.getComponent('mobilegaussmap')
            except KeyError:
                pass

        #print sensorInputs
        for sInput in sensorInputs:
            if 'Shake' in sInput and sInput['Shake'] == 1:
                #print 'increase!'
                self.mapper.argDict['Width'] += 30
                #self.mapper.argDict['CutoffDist'] += 20                
                sInput['Shake'] = 0
                print 'Width:' + str(compReg.getComponent('mobilegaussmap').argDict['Width'])
                #print 'CutoffDist: '+ str(compReg.getComponent('mobilegaussmap').argDict['CutoffDist'])
                
        return (sensorInputs, recursiveInputs)