ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A

How do the executors check if a subscriber has something to do?


I’m looking into the lower levels of ROS2, specifically the executors. In the spin we use Executor::get_next_ready_executable to get the next AnyExecutable that has something do do (“Check the subscriptions to see if there are any that are ready”). At first, I interpreted this as looking for a subscriber that has a non-empty msgs queue. But the get_next_subscription only looks as group->can_be_taken_from, which does not depend (in an obvious way, maybe I have missed something) on the queue.

So how should I interpret these calls and how can I check if there really is anything to do for the subscribers? (Is there any other way than calling _take and check the bool* ‘taken’?)

Thanks for your question. However we ask that you please ask questions on following our support guidelines: Support - ROS Wiki

ROS Discourse is for news and general interest discussions. ROS Answers provides a Q&A site which can be filtered by tags to make sure the relevant people can find and/or answer the question, and not overload everyone with hundreds of posts.

Sorry! I copied the topic, so this thread can be deleted!

Here’s the answers question for reference.