forked from priseborough/InertialNav
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_optflow.py
More file actions
31 lines (25 loc) · 891 Bytes
/
plot_optflow.py
File metadata and controls
31 lines (25 loc) · 891 Bytes
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
#!/bin/python
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import numpy as np
import math
data = np.genfromtxt('OptFlowFuse.txt', delimiter=' ', skip_header=1,
skip_footer=1, names=['time', 'ILOSX', 'VLOSX', 'ILOSY', 'VLOSY'])
figOptFlow = plt.figure()
ax1 = figOptFlow.add_subplot(211)
SLOSX = pow(data['VLOSX'],0.5)
ax1.set_title("Optical Flow Innovations")
ax1.set_xlabel('time (s)')
ax1.set_ylabel('X LOS rate (rad/sec)')
ax1.plot(data['time'], data['ILOSX'], color='b')
ax1.plot(data['time'], SLOSX, color='r')
ax1.plot(data['time'], -SLOSX, color='r')
ax2 = figOptFlow.add_subplot(212)
SLOSY = pow(data['VLOSY'],0.5)
ax2.set_xlabel('time (s)')
ax2.set_ylabel('Y LOS rate (rad/sec)')
ax2.plot(data['time'], data['ILOSY'], color='b')
ax2.plot(data['time'], SLOSY, color='r')
ax2.plot(data['time'], -SLOSY, color='r')
plt.show()