forked from miguelasd688/4-legged-robot-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_telemetry.py
74 lines (58 loc) · 1.59 KB
/
run_telemetry.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 13 20:31:07 2020
@author: miguel-asd
"""
import numpy as np
import pandas as pd
from itertools import count
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
plt.style.use('dark_background')
index = count()
def animate(i):
data = pd.read_csv('telemetry/data.csv')
print(type(data))
x = np.array(data['t'])
y1 = np.array(data['FRc'])
y2 = np.array(data['FRf'])
y3 = np.array(data['FRt'])
y4 = np.array(data['FLc'])
y5 = data['FRt']
y6 = data['FLt']
y7 = data['BRt']
y8 = data['BLt']
y9 = data['FRf']
y10 = data['FLf']
y11 = data['BLf']
y12 = data['BLf']
xlim = x[-1]#.values[-1]
plt.clf()
# plt.subplot(121)
plt.plot(x, y1+90, label='FR')
plt.plot(x, y2+30, label='FL')
plt.plot(x, y3-30, label='BR')
plt.plot(x, y4-90, label='BL')
# plt.plot(x, y7+5, label='BRt')
# plt.plot(x, y11+5, label='BRf')
#
# plt.plot(x, y8+15, label='BLt')
# plt.plot(x, y12+15, label='BLf')
plt.xlim(xlim-15,xlim)
plt.ylim(-100,130)
plt.title('Statimated force.')
plt.legend(loc='upper left')
# plt.subplot(122)
# plt.plot(x, y1, label='FRc')
# plt.plot(x, y2, label='FLc')
# plt.plot(x, y3, label='BRc')
# plt.plot(x, y4, label='BLc')
# plt.xlim(xlim-30,xlim)
# plt.ylim(-20,20)
# plt.title('Body orientation.')
# plt.legend(loc='upper left')
plt.tight_layout()
ani1 = FuncAnimation(plt.gcf(), animate, interval=25)
plt.tight_layout()
plt.show()