Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: ('I', 1) #31

Open
Jason1213666 opened this issue May 20, 2020 · 3 comments
Open

KeyError: ('I', 1) #31

Jason1213666 opened this issue May 20, 2020 · 3 comments

Comments

@Jason1213666
Copy link

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
Copy link

eucww commented Jul 30, 2022

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

@boazMgm
Copy link

boazMgm commented Jan 29, 2023

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

@huixiancheng
Copy link

one possible solution: change here

pypcd/pypcd/pypcd.py

Lines 64 to 72 in 20b032b

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('int16'), ('I', 2)),
(np.dtype('int32'), ('I', 4)),
(np.dtype('int64'), ('I', 8))]

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))]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants