-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathplot.py
73 lines (69 loc) · 2.16 KB
/
plot.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
import numpy as np
import matplotlib.pyplot as plt
#---------------------------------------------------------------
# read data from file
data = np.loadtxt('log_ekf_time_per_frame', delimiter=',')
# extract x and y values
x = data[:, 0]
y = data[:, 1]
# plot data
fig1 = plt.figure(figsize=(8, 2))
plt.plot(x, y, '-', color='red', linewidth=.5)
plt.xlabel('Execution time (s)')
plt.ylabel('Computational time (s)')
plt.title('Local SLAM: computational time per frame')
plt.ylim(0, 0.05)
plt.xlim(0, 278)
# -------------------------------------------------------------
data = np.loadtxt('log_gmap_time_per_step', delimiter=',')
# extract x and y values
x = data[:, 0]
y = data[:, 1]
# plot data
fig2 = plt.figure(figsize=(8, 2))
plt.plot(x, y, '-', color='red', linewidth=1)
plt.xlabel('Steps')
plt.ylabel('Computational time (s)')
plt.title('Global map: computational time per step')
#plt.ylim(0, 0.06)
plt.xlim(0, 194)
# -------------------------------------------------------------
data = np.loadtxt('log_cloop_time_per_step', delimiter=',')
# extract x and y values
x = data[:, 0]
y = data[:, 1]
# plot data
fig3 = plt.figure(figsize=(8, 2))
plt.plot(x, y, '-', color='red', linewidth=1)
plt.xlabel('Steps')
plt.ylabel('Computational time (s)')
plt.title('Close loop: computational search time per step')
#plt.ylim(0, 0.06)
plt.xlim(0, 2660)
#---------------------------------------------------------------
data = np.loadtxt('log_ekf_feats_per_frame', delimiter=',')
# extract x and y values
x = data[:, 0]
y = data[:, 1]
# plot data
fig4 = plt.figure(figsize=(8, 2))
plt.plot(x, y, '-', color='blue', linewidth=1)
plt.xlabel('Execution time (s)')
plt.ylabel('Number of map features')
plt.title('Local SLAM: number of map features per frame')
#plt.ylim(0, 0.06)
plt.xlim(0, 278)
#-------------------------------------------------------------
data = np.loadtxt('log_gmap_anchors_per_step', delimiter=',')
# extract x and y values
x = data[:, 0]
y = data[:, 1]
# plot data
fig5 = plt.figure(figsize=(8, 2))
plt.plot(x, y, '-', color='blue', linewidth=1)
plt.xlabel('Steps')
plt.ylabel('Number of anchors')
plt.title('Global map: number of anchors per step')
#plt.ylim(0, 0.06)
plt.xlim(0, 194)
plt.show()