Add Executor::spin_some

This commit is contained in:
Jackie Kay 2015-08-13 14:30:16 -07:00
parent 872edfc743
commit 5a704c772a

View file

@ -123,13 +123,17 @@ public:
void spin_node_some(rclcpp::node::Node::SharedPtr & node) void spin_node_some(rclcpp::node::Node::SharedPtr & node)
{ {
this->add_node(node, false); this->add_node(node, false);
// non-blocking = true spin_some();
this->remove_node(node, false);
}
virtual void spin_some()
{
while (AnyExecutable::SharedPtr any_exec = while (AnyExecutable::SharedPtr any_exec =
get_next_executable(std::chrono::milliseconds::zero())) get_next_executable(std::chrono::milliseconds::zero()))
{ {
execute_any_executable(any_exec); execute_any_executable(any_exec);
} }
this->remove_node(node, false);
} }
// Support dynamic switching of memory strategy // Support dynamic switching of memory strategy