ros-perception/perception_open3d

Non-Variadic Function for open3d::t::geometry::PointCloud to sensor_msgs::PointCloud2

willat343 opened this issue · 0 comments

Currently the available method is variadic, whereby the user passes arguments like "xyz", "float" and , which (as far as i'm aware) requires knowledge of the fields at compile-time. By replacing the variadic structure with a std::vector<std::pair<std::string,std::string>> or similar, the fields could be determined at run-time. Alternatively, 2 functions could be provided for the open3dToRos function for converting tensor types, since the variadic one is convenient if you know the fields.

The example application where I have run into this issue is very simple:

  1. Receive a pointcloud in ROS with fields I don't know about in advance (e.g. intensity, ring, ambience, x, y, z, r, g, b), which is common if dealing with lidars from different sensor drivers
  2. Perform some operation on this pointcloud, e.g. filter out all points beyond a certain range, with the assumption that there are x, y, z points
  3. Publish the resultant pointcloud with all the fields (this is not possible with open3d::geometry::PointCloud but is with the tensor versoin)