Skip to content

Commit

Permalink
Waitable should check callback_group if it can be executed. (#1001) (#…
Browse files Browse the repository at this point in the history
…1014)

Signed-off-by: Tomoya Fujita <[email protected]>
(cherry picked from commit 7780fa1)

Co-authored-by: Tomoya Fujita <[email protected]>
  • Loading branch information
mergify[bot] and fujitatomoya authored Nov 3, 2022
1 parent 351e707 commit ce00d65
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rclpy/rclpy/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,11 @@ def _wait_for_ready_callbacks(
for wt in node.waitables:
# Only check waitables that were added to the wait set
if wt in waitables and wt.is_ready(wait_set):
handler = self._make_handler(
wt, node, lambda e: e.take_data(), self._execute_waitable)
yielded_work = True
yield handler, wt, node
if wt.callback_group.can_execute(wt):
handler = self._make_handler(
wt, node, lambda e: e.take_data(), self._execute_waitable)
yielded_work = True
yield handler, wt, node

# Process ready entities one node at a time
for node in nodes_to_use:
Expand Down

0 comments on commit ce00d65

Please sign in to comment.