Can I specify usage of MultiThreadedExecutor for ComposableNodeContainer?

asked 2021-09-07 16:16:40 -0500

msmcconnell gravatar image

updated 2021-09-08 08:02:09 -0500

I have some composable nodes I wish to run in a single process using the ComposableNodeContainer. One of these nodes has a subscription to a topic with large messages that I would like handled by a separate thread. Normally, for a non-composed setup you would create a separate callback group and then spin the node in a MultiThreadedExecutor. My understanding of the ComposableNodeContainer is that it runs the provided nodes each in an executor, but I have not been able to track down if this is a SingleThreaded or MultiThreaded executor. If I assign a separate callback group to this topic subscription, will ComposablenNodeContainer use a MultiThreaded executor and allow it to spin on its own thread or does this setup require a custom container to run my composable nodes? I am currently using ROS2 Foxy.

Edit: As I have looked into this further it seems to me that I can use the executable argument for ComposableNodeContainer to set it to the multithreaded variant executable='component_container_mt' instead of executable='component_container' can anyone confirm this is the right approach?

edit retag flag offensive close merge delete