Skip to content

Composition#65

Open
chriseichmann wants to merge 5 commits intomasterfrom
composition
Open

Composition#65
chriseichmann wants to merge 5 commits intomasterfrom
composition

Conversation

@chriseichmann
Copy link
Collaborator

@chriseichmann chriseichmann commented Nov 11, 2025

Node composition contributed by @JinyongJeong-Riibotics as part of #59, rebased onto the current master branch

  • provide both new and old constructor signatures to ensure backward compatibility
  • add documentation on component
  • add example launch file

Initial PR description below:

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

  1. Constructor Signature
    The primary constructor now accepts rclcpp::NodeOptions, ensuring the driver can be instantiated as a composable node.

  2. Component Registration
    The node is registered with rclcpp_components_register_node, allowing it to be loaded dynamically into a component container.

  3. Subscriber Count Check
    Before each publish, the driver verifies that at least one subscriber is connected, eliminating unnecessary work when no consumers are present.

  4. 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.

  5. 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.

Signed-off-by: Christian Eichmann <eichmann@fzi.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants