MCPcopy Create free account
hub / github.com/MIT-SPARK/Kimera-VIO / main

Function main

scripts/plotting/python_plotter.py:30–67  ·  view source on GitHub ↗

Main

()

Source from the content-addressed store, hash-verified

28 return matrix
29
30def main():
31 "Main"
32 matrix = read_values("./output_landmarks.txt")
33 matrix = np.array(matrix, dtype=float)
34 z_values = matrix[:, 2]
35 print z_values
36 delta_z = 0.01
37 min_z = -0.5
38 max_z = 2.0
39 array_elements = int(math.ceil((max_z - min_z) / delta_z))
40
41 # the histogram of the data
42 # n, bins, patches = plt.hist(z_values, bins=array_elements, density=False,
43 # facecolor='g', alpha=0.75)
44 n, bins, patches = plt.hist(z_values, bins=100, density=False,
45 facecolor='g', alpha=0.75)
46
47 plt.xlabel('Z')
48 plt.ylabel('Number of Landmarks')
49 plt.title('Histogram of Landmarks by Z component')
50 plt.axis([min_z, max_z, min(n), max(n)])
51 plt.grid(True)
52 plt.show()
53
54 matrix_normals = read_values("./output_normals.txt")
55 matrix_normals = np.array(matrix_normals, dtype=float)
56 theta = normal_to_theta(matrix_normals)
57
58 number_bins = 50
59 n, bins, patches = plt.hist(theta, bins=number_bins, density=False,
60 facecolor='g', alpha=0.75)
61
62 plt.xlabel('Theta[rad]')
63 plt.ylabel('Number of normals')
64 plt.title('Histogram of Normals by theta')
65 plt.axis([-math.pi/2, math.pi/2, 0, max(n)+10])
66 plt.grid(True)
67 plt.show()
68
69if __name__ == "__main__":
70 main()

Callers 1

python_plotter.pyFile · 0.70

Calls 2

read_valuesFunction · 0.85
normal_to_thetaFunction · 0.85

Tested by

no test coverage detected