q3dviewer 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {q3dviewer-1.0.1.dist-info → q3dviewer-1.0.3.dist-info}/METADATA +1 -1
- q3dviewer-1.0.3.dist-info/RECORD +5 -0
- q3dviewer-1.0.3.dist-info/top_level.txt +1 -0
- q3dviewer/__init__.py +0 -4
- q3dviewer/basic_viewer.py +0 -56
- q3dviewer/custom_items/__init__.py +0 -9
- q3dviewer/custom_items/axis_item.py +0 -73
- q3dviewer/custom_items/camera_frame_item.py +0 -173
- q3dviewer/custom_items/cloud_io_item.py +0 -83
- q3dviewer/custom_items/cloud_item.py +0 -297
- q3dviewer/custom_items/gaussian_item.py +0 -267
- q3dviewer/custom_items/grid_item.py +0 -37
- q3dviewer/custom_items/image_item.py +0 -169
- q3dviewer/custom_items/text_item.py +0 -53
- q3dviewer/custom_items/trajectory_item.py +0 -78
- q3dviewer/gau_io.py +0 -168
- q3dviewer/tools/__init__.py +0 -6
- q3dviewer/tools/cloud_viewer.py +0 -75
- q3dviewer/tools/example_viewer.py +0 -38
- q3dviewer/tools/gaussian_viewer.py +0 -55
- q3dviewer/tools/lidar_calib.py +0 -274
- q3dviewer/tools/lidar_cam_calib.py +0 -299
- q3dviewer/tools/mesh_viewer.py +0 -57
- q3dviewer/tools/ros_viewer.py +0 -102
- q3dviewer/utils.py +0 -146
- q3dviewer/viewer_widget.py +0 -183
- q3dviewer-1.0.1.dist-info/RECORD +0 -28
- q3dviewer-1.0.1.dist-info/top_level.txt +0 -1
- {q3dviewer-1.0.1.dist-info → q3dviewer-1.0.3.dist-info}/WHEEL +0 -0
- {q3dviewer-1.0.1.dist-info → q3dviewer-1.0.3.dist-info}/entry_points.txt +0 -0
q3dviewer/tools/ros_viewer.py
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
from q3dviewer.utils import make_transform
|
|
5
|
-
import q3dviewer as q3d
|
|
6
|
-
import rospy
|
|
7
|
-
from nav_msgs.msg import Odometry
|
|
8
|
-
from sensor_msgs.msg import PointCloud2
|
|
9
|
-
import numpy as np
|
|
10
|
-
import random
|
|
11
|
-
from pypcd4 import PointCloud
|
|
12
|
-
from sensor_msgs.msg import Image
|
|
13
|
-
|
|
14
|
-
viewer = None
|
|
15
|
-
point_num_per_scan = None
|
|
16
|
-
color_mode = None
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def odomCB(data):
|
|
20
|
-
global viewer
|
|
21
|
-
pose = np.array(
|
|
22
|
-
[data.pose.pose.position.x,
|
|
23
|
-
data.pose.pose.position.y,
|
|
24
|
-
data.pose.pose.position.z])
|
|
25
|
-
rotation = np.array([
|
|
26
|
-
data.pose.pose.orientation.x,
|
|
27
|
-
data.pose.pose.orientation.y,
|
|
28
|
-
data.pose.pose.orientation.z,
|
|
29
|
-
data.pose.pose.orientation.w])
|
|
30
|
-
transform = make_transform(pose, rotation)
|
|
31
|
-
viewer['odom'].setTransform(transform)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def scanCB(data):
|
|
35
|
-
global viewer
|
|
36
|
-
global point_num_per_scan
|
|
37
|
-
global color_mode
|
|
38
|
-
pc = PointCloud.from_msg(data).pc_data
|
|
39
|
-
data_type = viewer['scan'].data_type
|
|
40
|
-
if 'rgb' in pc.dtype.names:
|
|
41
|
-
color = pc['rgb'].view(np.uint32)
|
|
42
|
-
else:
|
|
43
|
-
color = pc['intensity']
|
|
44
|
-
|
|
45
|
-
if color_mode is None:
|
|
46
|
-
if 'rgb' in pc.dtype.names:
|
|
47
|
-
color_mode = 'RGB'
|
|
48
|
-
else:
|
|
49
|
-
color_mode = 'I'
|
|
50
|
-
viewer['map'].setColorMode(color_mode)
|
|
51
|
-
|
|
52
|
-
cloud = np.rec.fromarrays(
|
|
53
|
-
[np.stack([pc['x'], pc['y'], pc['z']], axis=1), color],
|
|
54
|
-
dtype=data_type)
|
|
55
|
-
if (cloud.shape[0] > point_num_per_scan):
|
|
56
|
-
idx = random.sample(range(cloud.shape[0]), point_num_per_scan)
|
|
57
|
-
cloud = cloud[idx]
|
|
58
|
-
viewer['map'].setData(data=cloud, append=True)
|
|
59
|
-
viewer['scan'].setData(data=cloud)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
def imageCB(data):
|
|
63
|
-
image = np.frombuffer(data.data, dtype=np.uint8).reshape(
|
|
64
|
-
data.height, data.width, -1)
|
|
65
|
-
if (data.encoding == 'bgr8'):
|
|
66
|
-
image = image[:, :, ::-1] # convert bgr to rgb
|
|
67
|
-
viewer['img'].setData(data=image)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def main():
|
|
71
|
-
rospy.init_node('ros_viewer', anonymous=True)
|
|
72
|
-
|
|
73
|
-
global viewer
|
|
74
|
-
global point_num_per_scan
|
|
75
|
-
point_num_per_scan = 10000
|
|
76
|
-
map_item = q3d.CloudIOItem(size=1, alpha=0.1, color_mode='RGB')
|
|
77
|
-
scan_item = q3d.CloudItem(size=2, alpha=1, color_mode='#FFFFFF')
|
|
78
|
-
odom_item = q3d.GLAxisItem(size=0.5, width=5)
|
|
79
|
-
grid_item = q3d.GridItem(size=1000, spacing=20)
|
|
80
|
-
img_item = q3d.ImageItem(pos=np.array([0, 0]), size=np.array([800, 600]))
|
|
81
|
-
|
|
82
|
-
app = q3d.QApplication(['ROS Viewer'])
|
|
83
|
-
viewer = q3d.Viewer(name='ROS Viewer')
|
|
84
|
-
|
|
85
|
-
viewer.addItems({'map': map_item, 'scan': scan_item,
|
|
86
|
-
'odom': odom_item, 'grid': grid_item, 'img': img_item})
|
|
87
|
-
|
|
88
|
-
point_num_per_scan = rospy.get_param("scan_num", 100000)
|
|
89
|
-
print("point_num_per_scan: %d" % point_num_per_scan)
|
|
90
|
-
rospy.Subscriber(
|
|
91
|
-
"/cloud_registered", PointCloud2, scanCB,
|
|
92
|
-
queue_size=1, buff_size=2**24)
|
|
93
|
-
rospy.Subscriber(
|
|
94
|
-
"/odometry", Odometry, odomCB, queue_size=1, buff_size=2**24)
|
|
95
|
-
rospy.Subscriber('/image', Image, imageCB)
|
|
96
|
-
|
|
97
|
-
viewer.show()
|
|
98
|
-
app.exec_()
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if __name__ == "__main__":
|
|
102
|
-
main()
|
q3dviewer/utils.py
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
import time
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def rainbow(scalars, scalar_min=0, scalar_max=255):
|
|
6
|
-
range = scalar_max - scalar_min
|
|
7
|
-
values = 1.0 - (scalars - scalar_min) / range
|
|
8
|
-
# values = (scalars - scalar_min) / range # using inverted color
|
|
9
|
-
colors = np.zeros([scalars.shape[0], 3], dtype=np.float32)
|
|
10
|
-
values = np.clip(values, 0, 1)
|
|
11
|
-
|
|
12
|
-
h = values * 5.0 + 1.0
|
|
13
|
-
i = np.floor(h).astype(int)
|
|
14
|
-
f = h - i
|
|
15
|
-
f[np.logical_not(i % 2)] = 1 - f[np.logical_not(i % 2)]
|
|
16
|
-
n = 1 - f
|
|
17
|
-
|
|
18
|
-
# idx = i <= 1
|
|
19
|
-
colors[i <= 1, 0] = n[i <= 1] * 255
|
|
20
|
-
colors[i <= 1, 1] = 0
|
|
21
|
-
colors[i <= 1, 2] = 255
|
|
22
|
-
|
|
23
|
-
colors[i == 2, 0] = 0
|
|
24
|
-
colors[i == 2, 1] = n[i == 2] * 255
|
|
25
|
-
colors[i == 2, 2] = 255
|
|
26
|
-
|
|
27
|
-
colors[i == 3, 0] = 0
|
|
28
|
-
colors[i == 3, 1] = 255
|
|
29
|
-
colors[i == 3, 2] = n[i == 3] * 255
|
|
30
|
-
|
|
31
|
-
colors[i == 4, 0] = n[i == 4] * 255
|
|
32
|
-
colors[i == 4, 1] = 255
|
|
33
|
-
colors[i == 4, 2] = 0
|
|
34
|
-
|
|
35
|
-
colors[i >= 5, 0] = 255
|
|
36
|
-
colors[i >= 5, 1] = n[i >= 5] * 255
|
|
37
|
-
colors[i >= 5, 2] = 0
|
|
38
|
-
return colors
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def euler_to_matrix(rpy):
|
|
42
|
-
roll, pitch, yaw = rpy
|
|
43
|
-
Rx = np.array([[1, 0, 0],
|
|
44
|
-
[0, np.cos(roll), -np.sin(roll)],
|
|
45
|
-
[0, np.sin(roll), np.cos(roll)]])
|
|
46
|
-
Ry = np.array([[np.cos(pitch), 0, np.sin(pitch)],
|
|
47
|
-
[0, 1, 0],
|
|
48
|
-
[-np.sin(pitch), 0, np.cos(pitch)]])
|
|
49
|
-
Rz = np.array([[np.cos(yaw), -np.sin(yaw), 0],
|
|
50
|
-
[np.sin(yaw), np.cos(yaw), 0],
|
|
51
|
-
[0, 0, 1]])
|
|
52
|
-
R = Rz @ Ry @ Rx
|
|
53
|
-
return R
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def matrix_to_euler(R):
|
|
57
|
-
sy = np.sqrt(R[0, 0]**2 + R[1, 0]**2)
|
|
58
|
-
singular = sy < 1e-6 # Check for gimbal lock
|
|
59
|
-
if not singular:
|
|
60
|
-
roll = np.arctan2(R[2, 1], R[2, 2]) # X-axis rotation
|
|
61
|
-
pitch = np.arctan2(-R[2, 0], sy) # Y-axis rotation
|
|
62
|
-
yaw = np.arctan2(R[1, 0], R[0, 0]) # Z-axis rotation
|
|
63
|
-
else:
|
|
64
|
-
# Gimbal lock case
|
|
65
|
-
roll = np.arctan2(-R[1, 2], R[1, 1])
|
|
66
|
-
pitch = np.arctan2(-R[2, 0], sy)
|
|
67
|
-
yaw = 0 # Arbitrarily set yaw to 0
|
|
68
|
-
|
|
69
|
-
return np.array([roll, pitch, yaw])
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def matrix_to_quaternion(matrix):
|
|
73
|
-
trace = matrix[0, 0] + matrix[1, 1] + matrix[2, 2]
|
|
74
|
-
if trace > 0:
|
|
75
|
-
s = 0.5 / np.sqrt(trace + 1.0)
|
|
76
|
-
w = 0.25 / s
|
|
77
|
-
x = (matrix[2, 1] - matrix[1, 2]) * s
|
|
78
|
-
y = (matrix[0, 2] - matrix[2, 0]) * s
|
|
79
|
-
z = (matrix[1, 0] - matrix[0, 1]) * s
|
|
80
|
-
else:
|
|
81
|
-
if matrix[0, 0] > matrix[1, 1] and matrix[0, 0] > matrix[2, 2]:
|
|
82
|
-
s = 2.0 * np.sqrt(1.0 + matrix[0, 0] - matrix[1, 1] - matrix[2, 2])
|
|
83
|
-
w = (matrix[2, 1] - matrix[1, 2]) / s
|
|
84
|
-
x = 0.25 * s
|
|
85
|
-
y = (matrix[0, 1] + matrix[1, 0]) / s
|
|
86
|
-
z = (matrix[0, 2] + matrix[2, 0]) / s
|
|
87
|
-
elif matrix[1, 1] > matrix[2, 2]:
|
|
88
|
-
s = 2.0 * np.sqrt(1.0 + matrix[1, 1] - matrix[0, 0] - matrix[2, 2])
|
|
89
|
-
w = (matrix[0, 2] - matrix[2, 0]) / s
|
|
90
|
-
x = (matrix[0, 1] + matrix[1, 0]) / s
|
|
91
|
-
y = 0.25 * s
|
|
92
|
-
z = (matrix[1, 2] + matrix[2, 1]) / s
|
|
93
|
-
else:
|
|
94
|
-
s = 2.0 * np.sqrt(1.0 + matrix[2, 2] - matrix[0, 0] - matrix[1, 1])
|
|
95
|
-
w = (matrix[1, 0] - matrix[0, 1]) / s
|
|
96
|
-
x = (matrix[0, 2] + matrix[2, 0]) / s
|
|
97
|
-
y = (matrix[1, 2] + matrix[2, 1]) / s
|
|
98
|
-
z = 0.25 * s
|
|
99
|
-
return np.array([x, y, z, w])
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
def quaternion_to_matrix(quaternion):
|
|
103
|
-
x, y, z, w = quaternion
|
|
104
|
-
q = np.array(quaternion[:4], dtype=np.float64, copy=True)
|
|
105
|
-
n = np.linalg.norm(q)
|
|
106
|
-
if np.any(n == 0.0):
|
|
107
|
-
raise ZeroDivisionError("bad quaternion input")
|
|
108
|
-
else:
|
|
109
|
-
m = np.empty((3, 3))
|
|
110
|
-
m[0, 0] = 1.0 - 2*(y**2 + z**2)/n
|
|
111
|
-
m[0, 1] = 2*(x*y - z*w)/n
|
|
112
|
-
m[0, 2] = 2*(x*z + y*w)/n
|
|
113
|
-
m[1, 0] = 2*(x*y + z*w)/n
|
|
114
|
-
m[1, 1] = 1.0 - 2*(x**2 + z**2)/n
|
|
115
|
-
m[1, 2] = 2*(y*z - x*w)/n
|
|
116
|
-
m[2, 0] = 2*(x*z - y*w)/n
|
|
117
|
-
m[2, 1] = 2*(y*z + x*w)/n
|
|
118
|
-
m[2, 2] = 1.0 - 2*(x**2 + y**2)/n
|
|
119
|
-
return m
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
def make_transform(pose, rotation):
|
|
123
|
-
transform = np.eye(4)
|
|
124
|
-
transform[0:3, 0:3] = quaternion_to_matrix(rotation)
|
|
125
|
-
transform[0:3, 3] = pose
|
|
126
|
-
return transform
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
class FPSMonitor():
|
|
130
|
-
def __init__(self):
|
|
131
|
-
self.stamp_record = []
|
|
132
|
-
|
|
133
|
-
def count(self):
|
|
134
|
-
cur_stamp = time.time()
|
|
135
|
-
self.stamp_record.append(cur_stamp)
|
|
136
|
-
while len(self.stamp_record) > 0:
|
|
137
|
-
if(cur_stamp - self.stamp_record[0] > 1.):
|
|
138
|
-
self.stamp_record.pop(0)
|
|
139
|
-
else:
|
|
140
|
-
break
|
|
141
|
-
return len(self.stamp_record)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
# euler = np.array([1, 0.1, 0.1])
|
|
145
|
-
# euler_angles = matrix_to_euler(euler_to_matrix(euler))
|
|
146
|
-
# print("Euler Angles:", euler_angles)
|
q3dviewer/viewer_widget.py
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
import pyqtgraph.opengl as gl
|
|
5
|
-
from pyqtgraph.Qt import QtCore
|
|
6
|
-
from PyQt5.QtWidgets import QWidget, QComboBox, QVBoxLayout, QHBoxLayout, \
|
|
7
|
-
QSizePolicy, QSpacerItem, QMainWindow
|
|
8
|
-
from OpenGL.GL import *
|
|
9
|
-
from PyQt5.QtGui import QKeyEvent, QVector3D
|
|
10
|
-
from PyQt5.QtWidgets import QApplication, QWidget
|
|
11
|
-
import numpy as np
|
|
12
|
-
from PyQt5.QtWidgets import QLabel, QLineEdit, \
|
|
13
|
-
QDoubleSpinBox, QSpinBox, QCheckBox
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class SettingWindow(QWidget):
|
|
17
|
-
def __init__(self):
|
|
18
|
-
super().__init__()
|
|
19
|
-
self.combo_items = QComboBox()
|
|
20
|
-
self.combo_items.currentIndexChanged.connect(self.onComboboxSelection)
|
|
21
|
-
main_layout = QVBoxLayout()
|
|
22
|
-
self.stretch = QSpacerItem(
|
|
23
|
-
10, 10, QSizePolicy.Minimum, QSizePolicy.Expanding)
|
|
24
|
-
main_layout.addWidget(self.combo_items)
|
|
25
|
-
self.layout = QVBoxLayout()
|
|
26
|
-
self.layout.addItem(self.stretch)
|
|
27
|
-
main_layout.addLayout(self.layout)
|
|
28
|
-
self.setLayout(main_layout)
|
|
29
|
-
self.setWindowTitle("Setting Window")
|
|
30
|
-
self.setGeometry(200, 200, 300, 200)
|
|
31
|
-
self.items = {}
|
|
32
|
-
|
|
33
|
-
def addSetting(self, name, item):
|
|
34
|
-
self.items.update({name: item})
|
|
35
|
-
self.combo_items.addItem("%s(%s)" % (name, item.__class__.__name__))
|
|
36
|
-
|
|
37
|
-
def clearSetting(self):
|
|
38
|
-
while self.layout.count():
|
|
39
|
-
child = self.layout.takeAt(0)
|
|
40
|
-
if child.widget():
|
|
41
|
-
child.widget().deleteLater()
|
|
42
|
-
|
|
43
|
-
def onComboboxSelection(self, index):
|
|
44
|
-
self.layout.removeItem(self.stretch)
|
|
45
|
-
# remove all setting of previous widget
|
|
46
|
-
self.clearSetting()
|
|
47
|
-
|
|
48
|
-
key = list(self.items.keys())
|
|
49
|
-
try:
|
|
50
|
-
item = self.items[key[index]]
|
|
51
|
-
item.addSetting(self.layout)
|
|
52
|
-
self.layout.addItem(self.stretch)
|
|
53
|
-
except AttributeError:
|
|
54
|
-
print("%s: No setting." % (item.__class__.__name__))
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class ViewWidget(gl.GLViewWidget):
|
|
58
|
-
def __init__(self):
|
|
59
|
-
self.followed_name = 'none'
|
|
60
|
-
self.named_items = {}
|
|
61
|
-
self.color = '#000000'
|
|
62
|
-
self.followable_item_name = ['none']
|
|
63
|
-
self.setting_window = SettingWindow()
|
|
64
|
-
super(ViewWidget, self).__init__()
|
|
65
|
-
|
|
66
|
-
def onFollowableSelection(self, index):
|
|
67
|
-
self.followed_name = self.followable_item_name[index]
|
|
68
|
-
|
|
69
|
-
def update(self):
|
|
70
|
-
if self.followed_name != 'none':
|
|
71
|
-
pos = self.named_items[self.followed_name].T[:3, 3]
|
|
72
|
-
self.opts['center'] = QVector3D(pos[0], pos[1], pos[2])
|
|
73
|
-
super().update()
|
|
74
|
-
|
|
75
|
-
def addSetting(self, layout):
|
|
76
|
-
label1 = QLabel("Set background color:")
|
|
77
|
-
label1.setToolTip("using '#xxxxxx', i.e. #FF4500")
|
|
78
|
-
box1 = QLineEdit()
|
|
79
|
-
box1.setToolTip("'using '#xxxxxx', i.e. #FF4500")
|
|
80
|
-
box1.setText(str(self.color))
|
|
81
|
-
box1.textChanged.connect(self.setBKColor)
|
|
82
|
-
layout.addWidget(label1)
|
|
83
|
-
layout.addWidget(box1)
|
|
84
|
-
label2 = QLabel("Set Focus:")
|
|
85
|
-
combo2 = QComboBox()
|
|
86
|
-
for name in self.followable_item_name:
|
|
87
|
-
combo2.addItem(name)
|
|
88
|
-
combo2.currentIndexChanged.connect(self.onFollowableSelection)
|
|
89
|
-
layout.addWidget(label2)
|
|
90
|
-
layout.addWidget(combo2)
|
|
91
|
-
|
|
92
|
-
def setBKColor(self, color):
|
|
93
|
-
if (type(color) != str):
|
|
94
|
-
return
|
|
95
|
-
if color.startswith("#"):
|
|
96
|
-
try:
|
|
97
|
-
self.setBackgroundColor(color)
|
|
98
|
-
self.color = color
|
|
99
|
-
except ValueError:
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
def addItem(self, name, item):
|
|
103
|
-
self.named_items.update({name: item})
|
|
104
|
-
if (item.__class__.__name__ == 'GLAxisItem'):
|
|
105
|
-
self.followable_item_name.append(name)
|
|
106
|
-
self.setting_window.addSetting(name, item)
|
|
107
|
-
super().addItem(item)
|
|
108
|
-
|
|
109
|
-
def mouseReleaseEvent(self, ev):
|
|
110
|
-
if hasattr(self, 'mousePos'):
|
|
111
|
-
delattr(self, 'mousePos')
|
|
112
|
-
|
|
113
|
-
def mouseMoveEvent(self, ev):
|
|
114
|
-
lpos = ev.localPos()
|
|
115
|
-
if not hasattr(self, 'mousePos'):
|
|
116
|
-
self.mousePos = lpos
|
|
117
|
-
diff = lpos - self.mousePos
|
|
118
|
-
self.mousePos = lpos
|
|
119
|
-
if ev.buttons() == QtCore.Qt.MouseButton.RightButton:
|
|
120
|
-
self.orbit(-diff.x(), diff.y())
|
|
121
|
-
elif ev.buttons() == QtCore.Qt.MouseButton.LeftButton:
|
|
122
|
-
pitch_abs = np.abs(self.opts['elevation'])
|
|
123
|
-
camera_mode = 'view-upright'
|
|
124
|
-
if (pitch_abs <= 45.0 or pitch_abs == 90):
|
|
125
|
-
camera_mode = 'view'
|
|
126
|
-
self.pan(diff.x(), diff.y(), 0, relative=camera_mode)
|
|
127
|
-
|
|
128
|
-
def keyPressEvent(self, ev: QKeyEvent):
|
|
129
|
-
step = 10
|
|
130
|
-
zoom_delta = 20
|
|
131
|
-
speed = 2
|
|
132
|
-
self.projectionMatrix().data()
|
|
133
|
-
|
|
134
|
-
pitch_abs = np.abs(self.opts['elevation'])
|
|
135
|
-
camera_mode = 'view-upright'
|
|
136
|
-
if (pitch_abs <= 45.0 or pitch_abs == 90):
|
|
137
|
-
camera_mode = 'view'
|
|
138
|
-
|
|
139
|
-
if ev.key() == QtCore.Qt.Key_M: # setting meun
|
|
140
|
-
print("Open setting windows")
|
|
141
|
-
self.openSettingWindow()
|
|
142
|
-
elif ev.key() == QtCore.Qt.Key_R:
|
|
143
|
-
print("Clear viewer")
|
|
144
|
-
for item in self.named_items.values():
|
|
145
|
-
try:
|
|
146
|
-
item.clear()
|
|
147
|
-
except AttributeError:
|
|
148
|
-
pass
|
|
149
|
-
elif ev.key() == QtCore.Qt.Key_Up:
|
|
150
|
-
if ev.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier:
|
|
151
|
-
self.pan(0, +step, 0, relative=camera_mode)
|
|
152
|
-
else:
|
|
153
|
-
self.orbit(azim=0, elev=-speed)
|
|
154
|
-
elif ev.key() == QtCore.Qt.Key_Down:
|
|
155
|
-
if ev.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier:
|
|
156
|
-
self.pan(0, -step, 0, relative=camera_mode)
|
|
157
|
-
else:
|
|
158
|
-
self.orbit(azim=0, elev=speed)
|
|
159
|
-
elif ev.key() == QtCore.Qt.Key_Left:
|
|
160
|
-
if ev.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier:
|
|
161
|
-
self.pan(+step, 0, 0, relative=camera_mode)
|
|
162
|
-
else:
|
|
163
|
-
self.orbit(azim=speed, elev=0)
|
|
164
|
-
|
|
165
|
-
elif ev.key() == QtCore.Qt.Key_Right:
|
|
166
|
-
if ev.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier:
|
|
167
|
-
self.pan(-step, 0, 0, relative=camera_mode)
|
|
168
|
-
else:
|
|
169
|
-
self.orbit(azim=-speed, elev=0)
|
|
170
|
-
|
|
171
|
-
elif ev.key() == QtCore.Qt.Key_Z:
|
|
172
|
-
self.opts['distance'] *= 0.999**(+zoom_delta)
|
|
173
|
-
elif ev.key() == QtCore.Qt.Key_X:
|
|
174
|
-
self.opts['distance'] *= 0.999**(-zoom_delta)
|
|
175
|
-
else:
|
|
176
|
-
super().keyPressEvent(ev)
|
|
177
|
-
|
|
178
|
-
def openSettingWindow(self):
|
|
179
|
-
if self.setting_window.isVisible():
|
|
180
|
-
self.setting_window.raise_()
|
|
181
|
-
|
|
182
|
-
else:
|
|
183
|
-
self.setting_window.show()
|
q3dviewer-1.0.1.dist-info/RECORD
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
q3dviewer/__init__.py,sha256=BCrGWEtwjdvK4CHgp1e5Wkyhabk6WdvY_7FKJdGJwGE,142
|
|
2
|
-
q3dviewer/basic_viewer.py,sha256=A7bMxutP1grnqE5A4tjODGrzNfFq6-c6MlNYj8t54WU,1609
|
|
3
|
-
q3dviewer/gau_io.py,sha256=fKry1eyeFdw_JO5JZqU3l66dzt43NGpHhX89ER_y38A,5900
|
|
4
|
-
q3dviewer/utils.py,sha256=xzUAXUhgxoJyPrnivnyrJWoQQg9LrDPhxgZo1Cp35kQ,4596
|
|
5
|
-
q3dviewer/viewer_widget.py,sha256=repcGWZZXRxua8C-3CYHumvkVoPQl8ycFPTBx5zovRg,6561
|
|
6
|
-
q3dviewer/custom_items/__init__.py,sha256=Isb3HPtymuxEev1hc81x51inzH6epomtBHBQsPp4gZY,446
|
|
7
|
-
q3dviewer/custom_items/axis_item.py,sha256=Er8HRSnOscROZ7fOZEESnrZp62A5kY4oqP-GCAXczYU,2353
|
|
8
|
-
q3dviewer/custom_items/camera_frame_item.py,sha256=hvpZ3UEnkbs1nHNr2R7huuy1MdvBmwQPiqqKImWWG8c,5622
|
|
9
|
-
q3dviewer/custom_items/cloud_io_item.py,sha256=nbZbZLX72CWNFrInpxwysA2usbCkgAUrwZEOOVWx9Mc,2816
|
|
10
|
-
q3dviewer/custom_items/cloud_item.py,sha256=gOIun2VOfarA4Xo_2vdyWpIII0vvWVcQ4VqCZsYj584,9711
|
|
11
|
-
q3dviewer/custom_items/gaussian_item.py,sha256=3YXdJxHNSdk0D2HS2VJvuGTUjbi9D_UcrWEXSzxP7BY,10177
|
|
12
|
-
q3dviewer/custom_items/grid_item.py,sha256=WuNzIHBhjAQ6e4fP5aBp5jSgYbrY7wrbP9PhRptuz7s,1150
|
|
13
|
-
q3dviewer/custom_items/image_item.py,sha256=qOT0r6p8_NcF5GVeJrrR8rJNe68U_jW1qrUDZ05O5hI,5312
|
|
14
|
-
q3dviewer/custom_items/text_item.py,sha256=lbJaXfpeyyxr6lhlMjypk4a079-aUpsrXFjGi-BTzPU,1872
|
|
15
|
-
q3dviewer/custom_items/trajectory_item.py,sha256=9gM5voiYk0j4JMEp3drF7VFYSPsJcEK7mibdx45OQDs,2778
|
|
16
|
-
q3dviewer/tools/__init__.py,sha256=OXoXCP15ApA04VGNukCufubyK3OG_dg8tQqaS-5vl0k,376
|
|
17
|
-
q3dviewer/tools/cloud_viewer.py,sha256=qqOLulsVBRnykbWxatHN0eto52sMwF9yOHz35-Ye_SQ,2322
|
|
18
|
-
q3dviewer/tools/example_viewer.py,sha256=aKydEeM_h9AUvgeVvaWqGsL4l7YHzgxvXhXibQhsuqQ,747
|
|
19
|
-
q3dviewer/tools/gaussian_viewer.py,sha256=o_Vu-kKGN6A0VffPcOBZCCDFGfg_56v94IoC0r7mv1Y,1489
|
|
20
|
-
q3dviewer/tools/lidar_calib.py,sha256=f57xgFD2A-YqEwxCo0fgEAtiPnEvhT2NhM0b4lrTaFU,10238
|
|
21
|
-
q3dviewer/tools/lidar_cam_calib.py,sha256=8LHe7rgr1WCXgcyy1dnFoENdfkANf_CDrwVUmZ85HfQ,10794
|
|
22
|
-
q3dviewer/tools/mesh_viewer.py,sha256=QjahZzNy71xIwV-RzlxAtZs8cO57QlOSmMeqJnylS8g,1542
|
|
23
|
-
q3dviewer/tools/ros_viewer.py,sha256=PZ6kod7QT5DdRXudYw_olFkd072GD8GTszovBjTL3Cs,2984
|
|
24
|
-
q3dviewer-1.0.1.dist-info/METADATA,sha256=iWXwr3_iGpcW7LmVMsmEFXTIVPl9nem1OJMVDVbegco,189
|
|
25
|
-
q3dviewer-1.0.1.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
|
|
26
|
-
q3dviewer-1.0.1.dist-info/entry_points.txt,sha256=6zSxtJ5cjcpc32sR_wkRqOaeiJFpEuLnJQckZE3niU0,316
|
|
27
|
-
q3dviewer-1.0.1.dist-info/top_level.txt,sha256=HFFDCbGu28txcGe2HPc46A7EPaguBa_b5oH7bufmxHM,10
|
|
28
|
-
q3dviewer-1.0.1.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
q3dviewer
|
|
File without changes
|
|
File without changes
|