Closed hynchl closed 4 years ago
same error happen in python3.5
If you checked through the PR logs, there is a merge request for a forked branch from klintan (https://github.com/klintan/pypcd). Thanks to his/her hardwork, that fork works much better than the current release of pypcd for Python 3. You can install it with pip using pip3 install --upgrade git+https://github.com/klintan/pypcd.git
for those who couldn't resolve, refer to this
def point_cloud_from_fileobj(f):
""" Parse pointcloud coming from file object f
"""
header = []
while True:
ln = f.readline().strip()
header.append(ln)
pdb.set_trace()
if ln.startswith(b'DATA'):
metadata = parse_header(header)
dtype = _build_dtype(metadata)
break
I changed 'DATA' to b'DATA' inside pypcd.py
I'm using python3.7.3 and change
cStringIO
to 'StringIO'. In my code, I usedpypcd.PointCloud.from_path(image_path + str(cnt) +".pcd")
and error that show 'TypeError: startswith first arg must be bytes or a tuple of bytes, not str' ocurred inif ln.startswith('DATA'):
(282, pypcd.py). I guess that this happened becauseln
is already binary but I don't know how to start to fix it. please, help me...