Commit f08d20d1 authored by Frida Heskebeck's avatar Frida Heskebeck
Browse files

Draft of script

parent 9f7aa3b8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 25 07:38:10 2020
@author: frida
"""
import numpy as np
#%%
def get_acc_data(y): # Get the real data here!
x = [1,6,10]
return np.ones(3)*x[np.mod(y,3)]
#%%
x = 1
freq = 100 # Hz ?
time_interval = 1 # s
xMin = np.inf
xMax = -np.inf
still = 15 # Tune these
walk = 25 # Tune these
y=0
while x and y < 10:
xMin = np.inf
xMax = -np.inf
for i in range(time_interval*freq):
try:
acc = get_acc_data(y) # Needs to implement this one
except:
x = 0
break
x = np.sum(np.abs(acc))
if x < xMin:
xMin = x
if x > xMax:
xMax = x
if xMin > -still and xMax < still: # Some limit for still
print("Still")
elif xMin > -walk and xMax < walk: # Some limit for walk
print("Walk")
else:
print("Run")
y+=1
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment