Commit 0bbc83a8 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Add timer diff to plot. Add *.jpg and *.measurement to .gitignore

parent 43c5aa4c
......@@ -2,4 +2,6 @@
*.o
*.pb.h
*.pb.cc
*.jpg
*.measurement
timingtest
......@@ -17,7 +17,7 @@ timingtest: timingtest.cpp defs.h \
gcc -O3 -std=c++11 -c -o $@ $<
measurement: timingtest
./timingtest > measurement_$$(date +"%Y-%m-%d_%H:%M").txt
./timingtest > $$(date +"%Y-%m-%d_%H:%M").measurement
clean:
......
......@@ -10,7 +10,12 @@ if __name__ == '__main__':
data = numpy.loadtxt(sys.argv[1])
print(data.shape)
assert data.shape[1] == 39, "Unexpected # columns %d" % data.shape[1]
seq = data[...,0]
t_tot = data[-1,2] - data[0,2]
t_robot = (data[...,1] - data[0,1]) / (data[-1,1] - data[0,1]) * t_tot
t_sensor = (data[...,2] - data[0,2]) / (data[-1,2] - data[0,2]) * t_tot
kp = data[...,4:18]
d_kp = kp[1:,1::2]-kp[0:-1,1::2]
pos = (data[...,18:32] - data[0,18:32]) * 180 / math.pi
......@@ -18,7 +23,7 @@ if __name__ == '__main__':
for i in range(0,7):
n = int(6.5/(i + 1)*1000)
cut = slice(1000,1000+n)
f, axarr = plt.subplots(3, sharex=True)
f, axarr = plt.subplots(4, sharex=True)
f.set_size_inches(15, 12)
axarr[0].set_title(r'$K_p^{act}-K_p^{ref}$')
axarr[0].plot(seq[cut],(kp[...,i*2]-kp[...,i*2+1])[cut])
......@@ -26,6 +31,8 @@ if __name__ == '__main__':
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])
axarr[3].set_title(r'$t_{robot} - t_{sensor}$')
axarr[3].plot(seq[cut],(t_robot - t_sensor)[cut])
f.savefig('axis_%d_%s.jpg' % (i + 1, sys.argv[1]))
plt.show()
......
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