Skip to content

Instantly share code, notes, and snippets.

@insaneyilin
Created March 12, 2021 05:50
Show Gist options
  • Save insaneyilin/cadb7e45d5315cc96eb4cf18a61fddbc to your computer and use it in GitHub Desktop.
Save insaneyilin/cadb7e45d5315cc96eb4cf18a61fddbc to your computer and use it in GitHub Desktop.
convert pcd to bin file
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