From be46324a77b8549f8ed352865601d061cdd6209b Mon Sep 17 00:00:00 2001 From: Maurice Date: Thu, 16 Apr 2026 00:18:10 +0700 Subject: [PATCH 1/4] Refactor component containers Signed-off-by: Maurice --- source/Concepts/Intermediate/About-Composition.rst | 6 +++--- source/Tutorials/Intermediate/Composition.rst | 12 +++++------- .../Intermediate/Writing-a-Composable-Node.rst | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/source/Concepts/Intermediate/About-Composition.rst b/source/Concepts/Intermediate/About-Composition.rst index 816cb54ea9c..82f783ec4a7 100644 --- a/source/Concepts/Intermediate/About-Composition.rst +++ b/source/Concepts/Intermediate/About-Composition.rst @@ -42,15 +42,15 @@ A component container is a host process that allows you to load and manage multi As of now, the following generic component container types are available: -* `component_container `__ +* ``component_container`` * The most generic component container that uses a single ``SingleThreadedExecutor`` to execute all components. -* `component_container_mt `__ +* ``component_container --executor-type multi-threaded`` * Component container that uses a single ``MultiThreadedExecutor`` to execute the components. -* `component_container_isolated `__ +* ``component_container --executor-type single-threaded --isolated`` * Component container that uses a dedicated executor for each component: either ``SingleThreadedExecutor`` (default) or ``MultiThreadedExecutor``. diff --git a/source/Tutorials/Intermediate/Composition.rst b/source/Tutorials/Intermediate/Composition.rst index ebd5d0adba6..efaffb31149 100644 --- a/source/Tutorials/Intermediate/Composition.rst +++ b/source/Tutorials/Intermediate/Composition.rst @@ -197,25 +197,23 @@ Component container types As introduced in :ref:`ComponentContainer`, there are a few component container types with different options. You can choose the most appropriate component container type for your requirement. -* ``component_container`` (No options / parameters available) +* ``component_container`` with ``SingleThreadedExecutor``. .. code-block:: console $ ros2 run rclcpp_components component_container -* ``component_container_mt`` with ``MultiThreadedExecutor`` composed of 4 threads. +* ``component_container`` with ``MultiThreadedExecutor`` composed of 4 threads. * ``thread_num`` parameter option is available to specify the number of threads in ``MultiThreadedExecutor``. .. code-block:: console - $ ros2 run rclcpp_components component_container_mt --ros-args -p thread_num:=4 - -* ``component_container_isolated`` with ``MultiThreadedExecutor`` for each component. - * ``--use_multi_threaded_executor`` argument specifies executor type used for each component to ``MultiThreadedExecutor``. + $ ros2 run rclcpp_components component_container --executor-type multi-threaded --ros-args -p thread_num:=4 +* ``component_container`` with a dedicated ``MultiThreadedExecutor`` for each component. .. code-block:: console - $ ros2 run rclcpp_components component_container_isolated --use_multi_threaded_executor + $ ros2 run rclcpp_components component_container --executor-type multi-threaded --isolated Unloading components ^^^^^^^^^^^^^^^^^^^^ diff --git a/source/Tutorials/Intermediate/Writing-a-Composable-Node.rst b/source/Tutorials/Intermediate/Writing-a-Composable-Node.rst index 15b432d7ea2..2d633e3974c 100644 --- a/source/Tutorials/Intermediate/Writing-a-Composable-Node.rst +++ b/source/Tutorials/Intermediate/Writing-a-Composable-Node.rst @@ -168,4 +168,4 @@ you can replace it with .. caution:: - If you need multi-threading, instead of setting your executable to ``component_container``, set it to ``component_container_mt`` + If you need multi-threading, simply add the ``--executor-type multi-threaded`` argument to your container node. From 86ef94f1fb45b9a28eb22d500d76a9763918b89f Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 19 Apr 2026 21:34:41 +0700 Subject: [PATCH 2/4] Add option for EventsCBG executor Signed-off-by: Maurice --- source/Concepts/Intermediate/About-Composition.rst | 8 ++++++-- source/Concepts/Intermediate/About-Executors.rst | 6 ++++-- source/Tutorials/Intermediate/Composition.rst | 9 ++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/source/Concepts/Intermediate/About-Composition.rst b/source/Concepts/Intermediate/About-Composition.rst index 82f783ec4a7..7f2858923a4 100644 --- a/source/Concepts/Intermediate/About-Composition.rst +++ b/source/Concepts/Intermediate/About-Composition.rst @@ -44,15 +44,19 @@ As of now, the following generic component container types are available: * ``component_container`` - * The most generic component container that uses a single ``SingleThreadedExecutor`` to execute all components. + * Component container that uses a single ``SingleThreadedExecutor`` to execute the components. * ``component_container --executor-type multi-threaded`` * Component container that uses a single ``MultiThreadedExecutor`` to execute the components. +* ``component_container --executor-type events-cbg`` + + * Component container that uses a single ``EventsCBGExecutor`` to execute the components. + * ``component_container --executor-type single-threaded --isolated`` - * Component container that uses a dedicated executor for each component: either ``SingleThreadedExecutor`` (default) or ``MultiThreadedExecutor``. + * Component container that uses a dedicated executor for each component: available options are ``SingleThreadedExecutor`` (default), ``MultiThreadedExecutor``, and ``EventsCBGExecutor``. For more information about the types of executors, see the :ref:`TypesOfExecutors`. For more information about the options of each component container, see :ref:`ComponentContainerTypes` in the composition tutorial. diff --git a/source/Concepts/Intermediate/About-Executors.rst b/source/Concepts/Intermediate/About-Executors.rst index a1ce11a1843..296fcb4dc78 100644 --- a/source/Concepts/Intermediate/About-Executors.rst +++ b/source/Concepts/Intermediate/About-Executors.rst @@ -64,7 +64,7 @@ The Single-Threaded Executor is also used by the container process for :doc:`com Types of Executors ------------------ -Currently, rclcpp provides two Executor types, derived from a shared parent class: +Currently, rclcpp provides three Executor types, derived from a shared parent class: .. graphviz:: @@ -72,9 +72,11 @@ Currently, rclcpp provides two Executor types, derived from a shared parent clas Executor -> SingleThreadedExecutor [dir = back, arrowtail = empty]; Executor -> MultiThreadedExecutor [dir = back, arrowtail = empty]; + Executor -> EventsCBGExecutor [dir = back, arrowtail = empty]; Executor [shape=polygon,sides=4]; SingleThreadedExecutor [shape=polygon,sides=4]; MultiThreadedExecutor [shape=polygon,sides=4]; + EventsCBGExecutor [shape=polygon,sides=4]; } @@ -165,7 +167,7 @@ This semantics was first described in a `paper by Casini et al. at ECRTS 2019 Date: Sun, 19 Apr 2026 21:42:45 +0700 Subject: [PATCH 3/4] Lint Signed-off-by: Maurice --- source/Tutorials/Intermediate/Composition.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/Tutorials/Intermediate/Composition.rst b/source/Tutorials/Intermediate/Composition.rst index 71f19a0ee7c..f5bd9341aa4 100644 --- a/source/Tutorials/Intermediate/Composition.rst +++ b/source/Tutorials/Intermediate/Composition.rst @@ -204,20 +204,23 @@ You can choose the most appropriate component container type for your requiremen $ ros2 run rclcpp_components component_container * ``component_container`` with ``MultiThreadedExecutor`` composed of 4 threads. - * ``thread_num`` parameter option is available to specify the number of threads in ``MultiThreadedExecutor``. If omitted, the executor will run with the maximum available threads on the system. + * ``thread_num`` parameter option is available to specify the number of threads in ``MultiThreadedExecutor``. + If omitted, the executor will run with the maximum available threads on the system. .. code-block:: console $ ros2 run rclcpp_components component_container --executor-type multi-threaded --ros-args -p thread_num:=4 * ``component_container`` with ``EventsCBGExecutor`` composed of a single thread. - * ``thread_num`` parameter option is available to specify the number of threads in ``EventsCBGExecutor``. If omitted, the executor will run with the maximum available threads on the system. + * ``thread_num`` parameter option is available to specify the number of threads in ``EventsCBGExecutor``. + If omitted, the executor will run with the maximum available threads on the system. .. code-block:: console $ ros2 run rclcpp_components component_container --executor-type events-cbg --ros-args -p thread_num:=1 * ``component_container`` with a dedicated ``MultiThreadedExecutor`` for each component. + .. code-block:: console $ ros2 run rclcpp_components component_container --executor-type multi-threaded --isolated From 30582da1f68815e914946002ac4ff3788e95e6b2 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 19 Apr 2026 21:44:07 +0700 Subject: [PATCH 4/4] Lint again Signed-off-by: Maurice --- source/Tutorials/Intermediate/Composition.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Tutorials/Intermediate/Composition.rst b/source/Tutorials/Intermediate/Composition.rst index f5bd9341aa4..0a7e0281f40 100644 --- a/source/Tutorials/Intermediate/Composition.rst +++ b/source/Tutorials/Intermediate/Composition.rst @@ -204,7 +204,7 @@ You can choose the most appropriate component container type for your requiremen $ ros2 run rclcpp_components component_container * ``component_container`` with ``MultiThreadedExecutor`` composed of 4 threads. - * ``thread_num`` parameter option is available to specify the number of threads in ``MultiThreadedExecutor``. + * ``thread_num`` parameter option is available to specify the number of threads in ``MultiThreadedExecutor``. If omitted, the executor will run with the maximum available threads on the system. .. code-block:: console @@ -212,7 +212,7 @@ You can choose the most appropriate component container type for your requiremen $ ros2 run rclcpp_components component_container --executor-type multi-threaded --ros-args -p thread_num:=4 * ``component_container`` with ``EventsCBGExecutor`` composed of a single thread. - * ``thread_num`` parameter option is available to specify the number of threads in ``EventsCBGExecutor``. + * ``thread_num`` parameter option is available to specify the number of threads in ``EventsCBGExecutor``. If omitted, the executor will run with the maximum available threads on the system. .. code-block:: console