-
Notifications
You must be signed in to change notification settings - Fork 0
/
PointCloudViewer.py
107 lines (62 loc) · 1.75 KB
/
PointCloudViewer.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
"""
PosePipelineMaker.py
Generates and executes a pipeline to estimate poses
"""
import numpy as np
import time
import rospy
import numpy as np
from shutil import copyfile
from libs import *
import sys
import threading
import PointCloudVisualizer
import Classes.State as State
import CommandLine
from open3d import *
import Classes.Commands.CommandsImporterPC as CommandsImporterPC
def worker(state):
#boom = create_mesh_sphere(10)
#print(type(boom))
vis = Visualizer()
vis.create_window()
#vis.add_geometry(state.pcs[0])
#print("EEERRRRR")
#print(state.pcs)
count = 0
while state.stop_threads==False:
time.sleep(0.5)
if(state.updated==True):
count=count+1
print("UPDATE THEINGS",count)
state.updated=False
#print(state.pcs)
vis.add_geometry(state.pcs[0])
vis.update_geometry()
vis.poll_events()
vis.update_renderer()
def main(argv):
poses = FileIO.getFromPickle(argv[0])
state = State.State()
state.path=argv[0][0:argv[0].rfind('/')]
print(state.path)
state.camNames=poses['camnames']
state.R=poses['R']
state.t=poses['t']
print(poses)
print("YEET")
PointCloudVisualizer.PCViewer(poses,argv[0],(480,640),state)
#sets thread for terminal window
CommandLine.Start(state,CommandsImporterPC.CommandsImporterPC)
#sets thread for pipeline
#t1 = threading.Thread(target=worker,args=( state,))
#t1.start()
try:
print("SPINN")
rospy.spin()
except KeyboardInterrupt:
print("shut")
state.Stop()
#t1.join()
if __name__ == '__main__':
main(sys.argv[1:])