File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,30 @@ By making the process layout a deploy-time decision the user can choose between:
3333
3434Additionally ``ros2 launch `` can be used to automate these actions through specialized launch actions.
3535
36+ .. _ComponentContainer :
37+
38+ Component Container
39+ -------------------
40+
41+ A component container is a host process that allows you to load and manage multiple components at runtime within the same process space.
42+
43+ As of now, the following generic component container types are available:
44+
45+ * `component_container <https://github.com/ros2/rclcpp/blob/{REPOS_FILE_BRANCH}/rclcpp_components/src/component_container.cpp >`__
46+
47+ * The most generic component container that uses a single ``SingleThreadedExecutor `` to execute all components.
48+
49+ * `component_container_mt <https://github.com/ros2/rclcpp/blob/{REPOS_FILE_BRANCH}/rclcpp_components/src/component_container_mt.cpp >`__
50+
51+ * Component container that uses a single ``MultiThreadedExecutor `` to execute the components.
52+
53+ * `component_container_isolated <https://github.com/ros2/rclcpp/blob/{REPOS_FILE_BRANCH}/rclcpp_components/src/component_container_isolated.cpp >`__
54+
55+ * Component container that uses a dedicated executor for each component: either ``SingleThreadedExecutor `` (default) or ``MultiThreadedExecutor ``.
56+
57+ For more information about the types of executors, see the :ref: `TypesOfExecutors `.
58+ For more information about the options of each component container, see :ref: `ComponentContainerTypes ` in the composition tutorial.
59+
3660Writing a Component
3761-------------------
3862
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ The *wait set* is also used to detect when timers expire.
5959
6060The Single-Threaded Executor is also used by the container process for :doc: `components <./About-Composition >`, i.e. in all cases where nodes are created and executed without an explicit main function.
6161
62+ .. _TypesOfExecutors :
63+
6264Types of Executors
6365------------------
6466
Original file line number Diff line number Diff line change @@ -210,6 +210,33 @@ Advanced Topics
210210
211211Now that we have seen the basic operation of components, we can discuss a few more advanced topics.
212212
213+ .. _ComponentContainerTypes :
214+
215+ Component container types
216+ ^^^^^^^^^^^^^^^^^^^^^^^^^
217+
218+ As introduced in :ref: `ComponentContainer `, there are a few component container types with different options.
219+ You can choose the most appropriate component container type for your requirement.
220+
221+ * ``component_container `` (No options / parameters available)
222+
223+ .. code-block :: bash
224+
225+ ros2 run rclcpp_components component_container
226+
227+ * ``component_container_mt `` with ``MultiThreadedExecutor `` composed of 4 threads.
228+ * ``thread_num `` parameter option is available to specify the number of threads in ``MultiThreadedExecutor ``.
229+
230+ .. code-block :: bash
231+
232+ ros2 run rclcpp_components component_container_mt --ros-args -p thread_num:=4
233+
234+ * ``component_container_isolated `` with ``MultiThreadedExecutor `` for each component.
235+ * ``--use_multi_threaded_executor `` argument specifies executor type used for each component to ``MultiThreadedExecutor ``.
236+
237+ .. code-block :: bash
238+
239+ ros2 run rclcpp_components component_container_isolated --use_multi_threaded_executor
213240
214241 Unloading components
215242^^^^^^^^^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments