Filtering sensor_msgs::PointCloud2 agnostic of point type
Hi,
I am writing a basic filtering pipeline for 3D data (can be XYZRGB or RGBD or other types). My steps are as follows:
- Firstly, convert
sensor_msgs::PointCloud2
topcl::PointCloud<T>
. I want to work withpcl::PointCloud<T>
instead ofpcl::PointCloud2
because the former is recommended (as mentioned here) and some of the filters play nice with it (rather thanpcl::PointCloud2
). - Once I have converted
sensor_msgs::PointCloud2
topcl::PointCloud<T>
, then I have some generic filtering code that filters regardless of the template typeT
(wether it ispcl::PointXYZRGB
orpcl::PointXYZRGBA
orpcl::PointXYZI
).
So, how do I determine (at runtime) template type T
?
Thanks.