Hi, I won’t have the needed time or experience with ROS 2, but as this is the largest opportunity for API/ABI breaks this library will have for a long time, I wanted to bring in some ideas we implemented in our
ImprovedPCLFilters. They’re not published anywhere as the implementation required a number of ugly hacks I wouldn’t dare to put in a publicly available code. But if the ROS 2 port is done correctly, they could either be a direct part of it, or they could at least be much easier and cleaner done.
First, a few general things:
- Please, make all methods of
Filter virtual and protected. Currently,
computePublish() is non-virtual, and
input_indices_callback() is private and non-virtual, which makes extensions difficult. There’s also a hard blocker in ROS 1 for people to be generally able to make their own extensions based on the official
pcl_ros nodelets -
class_loader_hide_library_symbols. I’m not sure whether ROS 2 can do without it, but it’d be great.
- Review both the ROS and C++ API and unify it. As seen in the previous point, the
Filter class defines the camel-case
computePublish and snake-case
input_indices_callback. For the ROS part,
PassThroughFilter uses parameter
negative. Also the part with the dynamic reconfigure servers would deserve re-thinking to be more general (maybe it’d be possible to completely leave it out as ROS 2 support dynamic parameters out of the box).
- If PCL 1.9 is used, make sure that you either only allow the
keep_organized flag for filters that actually support it, or write a workaround to apply the flag manually. E.g. for
CropBox in PCL 1.9, you can set the flag, but it has no effect. (I have the code for this workaround).
- It also seems important to me that the nodelets correctly transform not only the
x, y, z channels of the pointcloud, but all position- or orientation-related channels like
vp_*. It’s probably best to leave the names of the channels as a user configuration option (see further).
In the next post, I’ll just re-post an excerpt from the documentation of our
ImprovedFilter which can serve as a source for improvement ideas. I can privately share our code implementing these functionalities with anyone who’s interested.