From 5a704c772a8d7422cb7fc26645b78c44c0a43051 Mon Sep 17 00:00:00 2001 From: Jackie Kay Date: Thu, 13 Aug 2015 14:30:16 -0700 Subject: [PATCH] Add Executor::spin_some --- rclcpp/include/rclcpp/executor.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rclcpp/include/rclcpp/executor.hpp b/rclcpp/include/rclcpp/executor.hpp index 954d73350a..11df4a0c77 100644 --- a/rclcpp/include/rclcpp/executor.hpp +++ b/rclcpp/include/rclcpp/executor.hpp @@ -123,13 +123,17 @@ class Executor void spin_node_some(rclcpp::node::Node::SharedPtr & node) { this->add_node(node, false); - // non-blocking = true + spin_some(); + this->remove_node(node, false); + } + + virtual void spin_some() + { while (AnyExecutable::SharedPtr any_exec = get_next_executable(std::chrono::milliseconds::zero())) { execute_any_executable(any_exec); } - this->remove_node(node, false); } // Support dynamic switching of memory strategy