Skip to content

Conversation

@AntoBrandi
Copy link
Contributor

@AntoBrandi AntoBrandi commented Nov 12, 2025

The purpose of this PR is to centralize the ROS-related interfaces in the PCLNode class.
Previously, operations like subscribing, publishing with message filters, transforming clouds, and so on, were centralized in the Filter class.

However, to extend this package with the development of new nodes (e.g. SACSegmentation), requires the duplication of some boilerplate code, as evident in #510.
This PR allows contributors to create new pcl_ros nodes as simple as

class MyPclNode : public PCLNode<Input<MyInput1, MyInput2>, Output>
{
private:
pcl::MyPCLImplementation<> impl_;

virtual rcl_interfaces::msg::SetParametersResult onParamsChanged(
const std::vectorrclcpp::Parameter & params) override;

public:
explicit MyPclNode(const rclcpp::NodeOptions & options);
virtual void compute(const MyInput1 & in1, MyInput2 & in2, MyOutput1 & out1) override;
};

Happy to get your feedback and eventually improve / adapt the code

@Rayman
Copy link
Contributor

Rayman commented Dec 9, 2025

Hi, thank you for this PR.

It is quite big, so at the moment I can't forsee the consequences for merging this regarging to API/ABI breaking. It will take a bit of time. Maybe somebody could help here.

Furthermore, a lot of tests are still failing.

@AntoBrandi
Copy link
Contributor Author

Hi @Rayman,
Thank you for taking your time to review it.
This MR is part of a bigger refactor I've worked on at @palrobotics.
Here you can find the full implementation of this work, along with an extensive documentation explaining the reasons for this refactor.

Basically, composing multiple PCL algorithms is very expensive if done through ROS 2 Components.
pipeline_example

In fact, each component in the pipeline needs to deserialize the data from ROS messages to PCL structure, perform the logic, and serialize the message back to a ROS message.
pipeline_components

The refactor allows users to compose PCL Algorithms as plugins (with pluginlib), where each plugin directly shares PCL pointers with the others and doesn't need to continuously serialize/deserialize messages.
This introduced a new concept of PCL Pipeline, which loads as many plugins as needed and implements the input/output interface. This way, also if a certain pipeline is composed of several PCL algorithms, the serialization/deserialization happens just once.
pipeline_plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants