def get_xyz_points(cloud_array, remove_nans=True):
'''
Pulls out x, y, and z columns from the cloud recordarray, and returns a 3xN matrix.
'''
# remove crap points
if remove_nans:
mask = np.isfinite(cloud_array['x']) & np.isfinite(cloud_array['y']) & np.isfinite(cloud_array['z'])
cloud_array = cloud_array[mask]
# pull out x, y, and z values
points = np.zeros(list(cloud_array.shape) + [3], dtype=np.float)
points[...,0] = cloud_array['x']
points[...,1] = cloud_array['y']
points[...,2] = cloud_array['z']
return points
评论列表
文章目录