Skip to content

feat: Implement CMake macro for registering nodes with CallbackIsolatedExecutor #37

@atsushi421

Description

@atsushi421

Summary

rclcpp_components_register_nodes() is a CMake macro for registering composable nodes with rclcpp_components::ComponentManager. However, when using CallbackIsolatedExecutor (CIE), a dedicated container (component_container_callback_isolated) must be used, and there is currently no way to specify the executor type at node registration time.

By providing a CIE-specific CMake macro, users can declaratively specify which executor to use when registering composable nodes.

Motivation

Current workflow:

  1. Register composable nodes with rclcpp_components_register_nodes()
  2. Manually specify component_container_callback_isolated in the launch file

This approach has the following issues:

  • No consistency guarantee between CMakeLists.txt and launch files: Since executor specification is separated between node registration and runtime, nodes may unintentionally run with the wrong executor
  • Usability: The configuration steps required to use CIE are scattered, making it difficult for new users to set up correctly

Proposed API

# Option 1: Wrapper around rclcpp_components_register_nodes
cie_register_nodes(<target> <node_class_name>)

# Option 2: Generic macro with executor as an argument
cie_components_register_node(<target>
  PLUGIN <node_class_name>
  EXECUTOR callback_isolated  # or "single"
)

Scope

  • Implement CMake macro/function (.cmake file)
  • Export from callback_isolated_executor package
  • Update documentation and samples (migrate cie_sample_application's CMakeLists.txt to the new macro)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions