Implicit multithreading in ROS2

asked 2020-06-10 07:19:01 -0500

KenYN gravatar image

updated 2020-06-10 23:21:14 -0500

There's a nice example of explicit multithreading here, but coming from ROS1 .launch files to launch.py scripts we lose the implicit multithreading and thread pooling of individual nodelets in a node manager but instead get everything in a single thread with the associated performance hit.

Am I missing a simple way to add all of my ComposableNode()s to a thread pool or something similar?

UPDATE: I've reported this as a bug.

edit retag flag offensive close merge delete

Comments

UPDATE: I've reported this as a bug.

how is this a bug exactly?

At maximum it seems like unexpected behaviour, but only if you allow yourself to assume the ROS 2 executors behave like ROS 1, which is not guaranteed (or even implied I believe).

gvdhoorn gravatar image gvdhoorn  ( 2020-06-11 02:18:36 -0500 )edit

I've found that ComposableNodeContainer(executable='component_container_mt', ...) does what I want.

KenYN gravatar image KenYN  ( 2020-06-16 21:56:12 -0500 )edit