Robotics StackExchange | Archived questions

Implicit multithreading in ROS2

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.

Asked by KenYN on 2020-06-10 07:19:01 UTC

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).

Asked by gvdhoorn on 2020-06-11 02:18:36 UTC

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

Asked by KenYN on 2020-06-16 21:56:12 UTC

Answers