dimatura / pypcd

PCL pcd fileformat i/o in Python
Other
266 stars 196 forks source link

KeyError: ('I', 1) #31

Open Jason1213666 opened 4 years ago

Jason1213666 commented 4 years ago

File "/home/ubuntu/pypcd/pypcd/pypcd.py", line 675, in from_path return point_cloud_from_path(fname) File "/home/ubuntu/pypcd/pypcd/pypcd.py", line 293, in point_cloud_from_path pc = point_cloud_from_fileobj(f) File "/home/ubuntu/pypcd/pypcd/pypcd.py", line 275, in point_cloud_from_fileobj dtype = _build_dtype(metadata) File "/home/ubuntu/pypcd/pypcd/pypcd.py", line 197, in _build_dtype np_type = pcd_type_to_numpy_type[(t, s)] KeyError: ('I', 1)

eucww commented 1 year ago

Hi, I got the same problem, have you solved that?

boazMgm commented 1 year ago

Hi, did you have some luck with this? I'm facing the same issue here. Thanks

huixiancheng commented 9 months ago

one possible solution: change here https://github.com/dimatura/pypcd/blob/20b032bfc729dec853ac810bceeb360f78bdc1d6/pypcd/pypcd.py#L64-L72 to:

numpy_pcd_type_mappings = [(np.dtype('float32'), ('F', 4)),
                           (np.dtype('float64'), ('F', 8)),
                           (np.dtype('uint8'), ('U', 1)),
                           (np.dtype('uint16'), ('U', 2)),
                           (np.dtype('uint32'), ('U', 4)),
                           (np.dtype('uint64'), ('U', 8)),
                           (np.dtype('int8'), ('I', 1)),
                           (np.dtype('int16'), ('I', 2)),
                           (np.dtype('int32'), ('I', 4)),
                           (np.dtype('int64'), ('I', 8))]