Skip to content

Commit 97f76c5

Browse files
clean-up tested + working
1 parent 799c566 commit 97f76c5

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

GEMstack/offboard/calibration/camera_to_vehicle_manual.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
N = 8 #how many point pairs you want to select
99

10-
# Update depending on where data is stored
10+
# Update Depending on Where Data Stored
1111
rgb_path = './data/color32.png'
1212
depth_path = './data/depth32.tif'
1313
lidar_path = './data/lidar32.npz'
@@ -59,7 +59,7 @@ def crop(pc,ix=None,iy=None,iz=None):
5959

6060
lidar_post = np.pad(lidar_points,((0,0),(0,1)),constant_values=1) @ lidar_ex.T[:,:3]
6161
lidar_post = crop(lidar_post,ix=(0,10),iy=(-5,5))
62-
vis(notebook=False).add_pc(lidar_post).show()
62+
# vis(notebook=False).add_pc(lidar_post).show()
6363

6464
#%%
6565
def pick_n_img(img,n=4):
@@ -161,13 +161,3 @@ def depth_to_points(depth_img: np.ndarray, intrinsics: np.ndarray):
161161
c2v = np.linalg.inv(v2c)
162162
print('camera->vehicle:',c2v)
163163

164-
v=vis(notebook=False)
165-
v.add_pc(lidar_post,color='blue')
166-
v.add_pc(np.pad(camera_points,((0,0),(0,1)),constant_values=1)@c2v.T[:,:3],color='red')
167-
v.show()
168-
169-
v=vis(notebook=False)
170-
# v.add_pc(np.pad(lidar_post,((0,0),(0,1)),constant_values=1)@v2c.T[:,:3],color='blue')
171-
v.add_pc(camera_points,color='red')
172-
v.show()
173-
# %%

GEMstack/offboard/calibration/lidar_to_vehicle.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ def pc_diff(pc0,pc1,tol=0.1):
9595
#================================================================
9696

9797
#%% load scene for ground plane
98-
sc = load_scene('/mount/wp/GEMstack/data/lidar1.npz')
98+
# Update depending on where data is stored
99+
sc = load_scene('./data/lidar1.npz')
99100

100101
# %% we crop to keep the ground
101102
cropped_sc = crop(sc,iz = (-3,-2))
@@ -133,9 +134,9 @@ def pc_diff(pc0,pc1,tol=0.1):
133134
rot = R.from_euler('xyz',[rx,ry,0]).as_matrix()
134135

135136
if False: # True to use the diff method to extract object.
136-
# load data
137-
sc0 = load_scene('/mount/wp/GEMstack/data/lidar70.npz')
138-
sc1 = load_scene('/mount/wp/GEMstack/data/lidar78.npz')
137+
# load data: update depending on where data is stored
138+
sc0 = load_scene('./data/lidar70.npz')
139+
sc1 = load_scene('./data/lidar78.npz')
139140

140141
sc0 = sc0 @ rot.T + [0,0,tz]
141142
sc1 = sc1 @ rot.T + [0,0,tz]
@@ -151,7 +152,8 @@ def pc_diff(pc0,pc1,tol=0.1):
151152
objects = pc_diff(cropped0,cropped1)
152153

153154
else: #False to use only cropping
154-
sc1 = load_scene('/mount/wp/GEMstack/data/lidar1.npz')
155+
# Update depending on where data is stored
156+
sc1 = load_scene('./data/lidar1.npz')
155157

156158
objects = sc1 @ rot.T + [0,0,tz]
157159

0 commit comments

Comments
 (0)