Closed QiuYilin closed 1 month ago
One way could be to load the file as a pcl::PCLPointCloud2
instead, check its fields
attribute, then convert to pcl::PointCloud<pcl::PointXYZ>
. See:
https://github.com/PointCloudLibrary/pcl/blob/master/io/include/pcl/io/pcd_io.h#L279
https://pointclouds.org/documentation/structpcl_1_1_p_c_l_point_cloud2.html
I think that the memory structures of PointCloud2 and PointXYZ are different, and the conversion will cause unnecessary time consumption. It may be better to provide an additional tool function.
The conversion happens anyway. If you load the file into a pcl::PointCloud<pcl::PointXYZ
, the conversion just happens internally in PCDReader
(see the first link I provided). What I described does not cause any additional time consumption, it only gives you access to the intermediate pcl::PCLPointCloud2
.
get
If I load a cloudxyz file as cloudxyzi, I want to explicitly warn at the software level.
I found that PCL will print this warning in the terminal but has removed this exception,and I didn't find a function to simply judge fields in pcl::io.
Is there any easy way to check the field, or redirect the content of pcl::console?