Created
March 12, 2021 05:50
-
-
Save insaneyilin/cadb7e45d5315cc96eb4cf18a61fddbc to your computer and use it in GitHub Desktop.
convert pcd to bin file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pypcd | |
filepath='hesai_pandar40p_1593421778.828716.pcd' | |
pc = pypcd.PointCloud.from_path(filepath) | |
points = [] | |
for pt in pc.pc_data: | |
points.append([pt[0], pt[1], pt[2], 0.0]) | |
points = np.array(points).astype(np.float32) | |
points.tofile('points.bin') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment