dimatura / pypcd

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

TypeError: object of type 'map' has no len() #24

Open pmsmall opened 5 years ago

pmsmall commented 5 years ago

File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 736, in from_path return point_cloud_from_path(fname) File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 303, in point_cloud_from_path pc = point_cloud_from_fileobj(f) File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 296, in point_cloud_from_fileobj return PointCloud(metadata, pc_data) File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 671, in init self.check_sanity() File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 683, in check_sanity assert(_metadata_is_consistent(md)) File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 177, in _metadata_is_consistent if not check(metadata): File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 162, in checks.append((lambda m: len((m['type'])) == len((m['count'])) == TypeError: object of type 'map' has no len()

In python 3, map has no len()

162 checks.append((lambda m: len(m['type']) == len(m['count']) == 163 len(m['fields']),

Add a list() to resolve the problems?

162 checks.append((lambda m: len(list(m['type'])) == len(list(m['count'])) == 163 len(list(m['fields'])),

DanielPollithy commented 5 years ago

The python3 port is in pull request #9