Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthias Mayr
AS1 Activity Recognition
Commits
f08d20d1
Commit
f08d20d1
authored
Mar 25, 2020
by
Frida Heskebeck
Browse files
Draft of script
parent
9f7aa3b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
script_frida.py
0 → 100644
View file @
f08d20d1
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment