Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
yumi-egmri-timingtest
Commits
890426c1
Commit
890426c1
authored
Apr 10, 2018
by
Anders Blomdell
Browse files
Added rough data analysis
parent
5c2f9c3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
analyze.py
0 → 100755
View file @
890426c1
#!/usr/bin/python3
import
sys
import
numpy
import
matplotlib.pyplot
as
plt
import
math
if
__name__
==
'__main__'
:
data
=
numpy
.
loadtxt
(
sys
.
argv
[
1
])
print
(
data
.
shape
)
assert
data
.
shape
[
1
]
==
32
,
"Unexpected # columns %d"
%
data
.
shape
[
1
]
seq
=
data
[...,
0
]
kp
=
data
[...,
4
:
11
]
d_kp
=
kp
[
1
:,...]
-
kp
[
0
:
-
1
,...]
pos
=
(
data
[...,
11
:
25
]
-
data
[
0
,
11
:
25
])
*
180
/
math
.
pi
torque
=
(
data
[...,
25
:
32
:]
-
data
[
0
,
25
:
32
])
for
i
in
range
(
0
,
7
):
n
=
4000
-
500
*
i
cut
=
slice
(
1000
,
1000
+
n
)
f
,
axarr
=
plt
.
subplots
(
3
,
sharex
=
True
)
axarr
[
0
].
set_title
(
r
'$\Delta K_p$'
)
axarr
[
0
].
plot
(
seq
[
1
:][
cut
],
d_kp
[...,
i
][
cut
])
axarr
[
1
].
set_title
(
'$\Delta Position$'
)
axarr
[
1
].
plot
(
seq
[
cut
],(
pos
[...,
i
*
2
]
-
pos
[...,
i
*
2
+
1
])[
cut
])
axarr
[
2
].
set_title
(
r
'Torque [Nm]'
)
axarr
[
2
].
plot
(
seq
[
cut
],
torque
[...,
i
][
cut
])
plt
.
show
()
Write
Preview
Supports
Markdown
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