forked from filchy/slam-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointmap.py
More file actions
28 lines (19 loc) · 664 Bytes
/
pointmap.py
File metadata and controls
28 lines (19 loc) · 664 Bytes
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
from slam import process
from display import Display
import numpy as np
import open3d as o3d
import cv2
class PointMap(object):
def __init__(self):
self.array = [0,0,0]
def collect_points(self, tripoints):
if len(tripoints) > 0:
array_to_project = np.array([0,0,0])
x_points = [pt for pt in tripoints[0]]
y_points = [-pt for pt in tripoints[1]]
z_points = [-pt for pt in tripoints[2]]
for i in range(tripoints.shape[1]):
curr_array = np.array([x_points[i], y_points[i], z_points[i]])
array_to_project = np.vstack((array_to_project, curr_array))
array_to_project = array_to_project[1:, :]
return array_to_project