Make sick safetyscanners2 compatible with composition#59
Make sick safetyscanners2 compatible with composition#59JinyongJeong-Riibotics wants to merge 11 commits intoSICKAG:masterfrom
Conversation
…ck_safetyscanners2 into improve/composition
Improve/composition
|
Thank you for the contribution! I will try to have a more detailed look into this in the coming days. In general, I like the idea to support composition, but need to be careful to not disrupt existing user applications. |
|
@chriseichmann — thank you for the quick response. I share your view that we must avoid disrupting existing projects. Unfortunately, this PR introduces many changes to enable composition and could break current applications. For that reason, the final decision on whether to merge rests with the repository’s maintenance team. If the team feels the risk to existing projects is too high, please let me know and I will close this PR. |
|
This is a very nice feature and we are really interested, thanks for the work 🙌 Is there anything I can do from my side to help this move forward? |
|
I will push the
|
|
Closing this in favor of #65 |
Purpose of this PR
The current driver does not support zero-copy intra-process communication (IPC) when used as a composed component.
This pull request introduces the required modifications to enable composition-friendly, zero-copy operation.
Key Changes
Constructor Signature
The primary constructor now accepts rclcpp::NodeOptions, ensuring the driver can be instantiated as a composable node.
Component Registration
The node is registered with rclcpp_components_register_node, allowing it to be loaded dynamically into a component container.
Subscriber Count Check
Before each publish, the driver verifies that at least one subscriber is connected, eliminating unnecessary work when no consumers are present.
Zero-Copy Publishing
Message data are created and published as std::unique_ptr objects.
In environments where IPC is enabled, this enables true zero-copy transfer; when IPC is disabled, behavior remains identical to standard publishing.
Reduced Copy Overhead
Internal data structures are generated directly into unique_ptr instances, minimizing intermediate copies and improving performance.
Maintainer Guidance
These changes, particularly the revised constructor, introduce breaking API differences.
If the new interface or zero-copy assumptions conflict with the project’s roadmap, please let me know. I will close this PR rather than disrupt the main branch.