From 8e6c9e3ea6d5f15e93e8030fa33e67b2e57177bf Mon Sep 17 00:00:00 2001 From: Janosch Machowinski Date: Sat, 13 Apr 2024 12:40:42 +0200 Subject: [PATCH] chore: Fixes for rebase Signed-off-by: Janosch Machowinski --- rclcpp/src/rclcpp/executor.cpp | 17 +++++------------ .../test_executors_callback_group_behavior.cpp | 2 ++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/rclcpp/src/rclcpp/executor.cpp b/rclcpp/src/rclcpp/executor.cpp index 8f0a68f157..90e53f558c 100644 --- a/rclcpp/src/rclcpp/executor.cpp +++ b/rclcpp/src/rclcpp/executor.cpp @@ -420,6 +420,10 @@ Executor::execute_any_executable( return; } + assert( + (void("cannot execute an AnyExecutable without a valid callback group"), + any_exec.callback_group)); + if (any_exec.timer) { TRACETOOLS_TRACEPOINT( rclcpp_executor_execute, @@ -450,18 +454,7 @@ Executor::execute_any_executable( }, exception_handler); } // Reset the callback_group, regardless of type - if(any_exec.callback_group) { - any_exec.callback_group->can_be_taken_from().store(true); - } - // Wake the wait, because it may need to be recalculated or work that - // was previously blocked is now available. - try { - interrupt_guard_condition_->trigger(); - } catch (const rclcpp::exceptions::RCLError & ex) { - throw std::runtime_error( - std::string( - "Failed to trigger guard condition from execute_any_executable: ") + ex.what()); - } + any_exec.callback_group->can_be_taken_from().store(true); } diff --git a/rclcpp/test/rclcpp/executors/test_executors_callback_group_behavior.cpp b/rclcpp/test/rclcpp/executors/test_executors_callback_group_behavior.cpp index 49391cd838..3d9a8bf32b 100644 --- a/rclcpp/test/rclcpp/executors/test_executors_callback_group_behavior.cpp +++ b/rclcpp/test/rclcpp/executors/test_executors_callback_group_behavior.cpp @@ -42,6 +42,8 @@ class CustomExecutor : public rclcpp::Executor void spin() override {} + void spin(const std::function &) override {} + void collect() { this->collect_entities();