Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/Concepts/Intermediate/About-Composition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/ros2/rclcpp/blob/{REPOS_FILE_BRANCH}/rclcpp_components/src/component_container.cpp>`__
* ``component_container``

* The most generic component container that uses a single ``SingleThreadedExecutor`` to execute all components.

* `component_container_mt <https://github.com/ros2/rclcpp/blob/{REPOS_FILE_BRANCH}/rclcpp_components/src/component_container_mt.cpp>`__
* ``component_container --executor-type multi-threaded``

* Component container that uses a single ``MultiThreadedExecutor`` to execute the components.

* `component_container_isolated <https://github.com/ros2/rclcpp/blob/{REPOS_FILE_BRANCH}/rclcpp_components/src/component_container_isolated.cpp>`__
* ``component_container --executor-type single-threaded --isolated``

* Component container that uses a dedicated executor for each component: either ``SingleThreadedExecutor`` (default) or ``MultiThreadedExecutor``.

Expand Down
12 changes: 5 additions & 7 deletions source/Tutorials/Intermediate/Composition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading