import numpy as np import modelEqMultiTWO as modE import matplotlib.pyplot as plt """ the sensor is below the middle finger and the magnet is on the middle finger """ """ acquiring data... """ #print "t:" #middleOff=datAcM.pipeAcquisition("gatttool -t random -b E3:C0:07:76:53:70 --char-write-req --handle=0x000f --value=0300 --listen", # "150814_middleOff", measNr=500, offset=50) #index=datAcM.textAcquistion("150813_onHand") middleOff=datAcM.textAcquistion("150814_middleOff") #middleNoOff=datAcM.textAcquistion("150814_middleNoOff") #middleOff=modE.movingAvg(middleOff, 10) """ the artificial data... """ #angle = [-0.02586, 0., 0.] # -0.02586 to wooden-angle(index) angle = [0.00920, 0.09138, 0.01087] # -0.02586 to wooden-angle(middle) # position of sensor #s1 = [-0.07789, 0.02825, 0.] # index finger s0 = [0.00920 , 0.02755, 0.] # middle finger #p0 = [-0.10375, 0.02825, 0.] # initial position of magnet (index) #r = -0.08 # length of index finger (from angle) r = 0.08829 # length of middle finger # values for the half circle t = np.arange(0, (1/2.*np.pi), 0.01)
import plotting as plo import numpy as np import modelEqMulti as modE import matplotlib.pyplot as plt """ the sensor is below the middle finger and the magnet is on the middle finger """ """ acquiring data... """ #print "t:" #fingDat=datAcM.pipeAcquisition("gatttool -t random -b E3:C0:07:76:53:70 --char-write-req --handle=0x000f --value=0300 --listen", # "150825_MidPin", measNr=500, offset=100) fingDat=datAcM.textAcquistion("150825_MidPin") # applying average filter avg=modE.moving_average(fingDat[0], 10) t=np.zeros(shape=[len(avg),1]) t=np.append(t,avg,axis=1) t=datAcM.sortData(t) fingDat=None fingDat=t """ the artificial data... """ angInd = [-0.02037, 0.02272, 0.01087] # to wooden-angle(index) (from sensor) angMid = [0., 0.02272, 0.01087] # to wooden-angle(middle) (from sensor) angRin = [-0.01939, 0.02272, 0.01087] # to wooden-angle(ring) (from sensor) angPin = [-0.03840, 0.02272, 0.01087] # to wooden-angle(pinky) (from sensor) # position of sensor
""" 150825 The solution to the curved shape in the x-direction: there are slight differences in x and z b-field values (bigger!) See plots! """ import dataAcquisitionMulti as datAcM import plotting as plo import numpy as np import modelEq as modE import matplotlib.pyplot as plt from timeit import default_timer as timer """ acquiring data... """ #dat=datAcM.pipeAcquisition("gatttool -t random -b E3:C0:07:76:53:70 --char-write-req --handle=0x000f --value=0300 --listen", # "150820_boardLSM1", measNr=400, offset=100) dat=datAcM.textAcquistion("150820_boardLSM1") #tmp = dat[0][45:245] #t=np.zeros(shape=[len(tmp),1]) #t=np.append(t,tmp,axis=1) #t=datAcM.sortData(t) #dat=None #dat=t avg=modE.moving_average(dat[0], 10) t=np.zeros(shape=[len(avg),1]) t=np.append(t,avg,axis=1) filtered=datAcM.sortData(t) #dat=None #dat=t """ the artificial data... """ angle = [0.02, 0., 0.02] # position of the nail in the board s0=[0.,0.,0.] # the sensor is the origin