forked from suk05112/ORBSLAM2_with_PCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.py
executable file
·62 lines (52 loc) · 2.09 KB
/
interface.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
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QGridLayout, QLabel, QLineEdit, QFileDialog
import subprocess
class MyApp(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def add_open(self):
FileOpen = QFileDialog.getOpenFileName(self, 'Open file', './')
self.label1.setText(FileOpen[0])
_file_name = FileOpen[0].split('/')[-1].split('.')[0]
self.file_name = _file_name
self.file_directory = FileOpen[0]
print("input: "+self.file_name+" and "+self.file_directory)
def map_add_open(self):
FileOpen = QFileDialog.getOpenFileName(self, 'Open file', './')
self.label2.setText(FileOpen[0])
self.pcd_name = FileOpen[0]
print("pcd file set to : "+self.pcd_name)
def map_sh(self):
subprocess.call('./UI/UI_start_mapping.sh '+self.file_directory+' '+self.file_name, shell=True)
print("finish")
def view_sh(self):
print("map view")
subprocess.call('./pcl/build/pcd_viewer_test '+self.pcd_name, shell=True)
def initUI(self):
grid = QGridLayout()
self.setLayout(grid)
self.label1 = QLabel(' ', self)
self.label2 = QLabel(' ', self)
btn1 = QPushButton('bag 파일 불러오기', self)
btn1.clicked.connect(self.add_open)
btn2 = QPushButton('지도 제작하기', self)
btn2.clicked.connect(self.map_sh)
btn3= QPushButton('지도 불러오기', self)
btn3.clicked.connect(self.map_add_open)
btn4= QPushButton('지도 확인하기', self)
btn4.clicked.connect(self.view_sh)
#grid.addWidget(QLabel('Bag : '), 0, 0)
grid.addWidget(btn1, 0, 0)
grid.addWidget(btn2, 0, 1)
grid.addWidget(btn3, 1, 0)
grid.addWidget(btn4, 1, 1)
grid.addWidget(self.label1, 2, 0)
grid.addWidget(self.label2, 3, 0)
self.setWindowTitle('Interface')
self.resize(300, 100)
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = MyApp()
sys.exit(app.exec_())