pcl
pcl copied to clipboard
Do not throw error for invalid count when field name is "_" (pcl::PCDReader::readHeader)
Description
For LIDAR pcd files, there can be instances where the count for a field is < 1 if the field is "_"
. In such cases, we shouldn't throw an error when trying to read the file.
Bugs resolved
https://github.com/PDAL/PDAL/issues/2572
Hi, sorry for the delay. I am not so sure about this code change. I feel like we might introduce bugs if we allow point fields with count < 1 (even if they are only "_" fields). Do you know how these LIDAR PCD files were created? The PCDWriter from PCL won't write fields with count=0. BTW a solution to "fix" such PCD files would be to remove the columns from the PCD header (remove the respective entries in FIELDS, SIZE, TYPE, COUNT).
same issue here. many PCD files provided by our client won't work due to this.
.PCD v0.7 - Point Cloud Data file format
VERSION 0.7 FIELDS x y z _ intensity _ timestamp _ ring _ SIZE 4 4 4 1 4 1 8 1 2 1 TYPE F F F U F U F U U U COUNT 1 1 1 4 1 0 1 6 1 12 WIDTH 93504 HEIGHT 1 VIEWPOINT 0 0 0 1 0 0 0 POINTS 93504 DATA binary
Instead of modifying the core lib, how about a tool to remove 0 count fields?
Or how about changing the PCDReader so that these fields are removed during reading, as if they had never been in the PCD file?
😆 Didn't realize this was not an issue, but a single line PR
This is still an issue in 2022. Will that PR be merged?
This is still an issue in 2022. Will that PR be merged?
Not with the changes it makes right now. Copied from my earlier comment:
I am not so sure about this code change. I feel like we might introduce bugs if we allow point fields with count < 1 (even if they are only "_" fields). Do you know how these LIDAR PCD files were created? The PCDWriter from PCL won't write fields with count=0. BTW a solution to "fix" such PCD files would be to remove the columns from the PCD header (remove the respective entries in FIELDS, SIZE, TYPE, COUNT).