From 6010f903cbd9c2aa621866b7273c85fc59c9cca1 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Mon, 29 May 2023 18:38:52 +0200 Subject: [PATCH] change to multithreaded executor --- src/api_communication/api_communication/api_listener.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api_communication/api_communication/api_listener.py b/src/api_communication/api_communication/api_listener.py index 0d98ebcb..2d3ae366 100644 --- a/src/api_communication/api_communication/api_listener.py +++ b/src/api_communication/api_communication/api_listener.py @@ -220,8 +220,9 @@ def main(args=None): rclpy.init(args=args) api_listener = ApiListener() - - rclpy.spin(api_listener) + multithreaded_executor = rclpy.executors.MultiThreadedExecutor() + multithreaded_executor.add_node(api_listener) + multithreaded_executor.spin() api_listener.destroy_node() rclpy.shutdown()