From 75f194cee5b90a157dc86c17106cc148f7c223e4 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Thu, 23 Jan 2025 22:31:13 +0100 Subject: [PATCH] check if the CM is assosicated to an executor --- controller_manager/src/controller_manager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index 4b2d5c7881..bef2985c0b 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -377,7 +377,10 @@ void ControllerManager::init_controller_manager() [this]() { RCLCPP_INFO(get_logger(), "Shutdown request received...."); - executor_->remove_node(this->get_node_base_interface()); + if (this->get_node_base_interface()->get_associated_with_executor_atomic().load()) + { + executor_->remove_node(this->get_node_base_interface()); + } executor_->cancel(); if (!this->shutdown_controllers()) {