ros2 / rclcpp

rclcpp (ROS Client Library for C++)
Apache License 2.0
513 stars 412 forks source link

Bug in Executor::get_next_ready_executable ? #2474

Closed jmachowinski closed 2 months ago

jmachowinski commented 3 months ago

Hey

https://github.com/ros2/rclcpp/blob/f9c4894f96ea083fc5acfcea4f1ea83850759e63/rclcpp/src/rclcpp/executor.cpp#L692

I am highly confused by this code block:

        auto callback_group = entity_iter->second.callback_group.lock();
        if (callback_group && !callback_group->can_be_taken_from()) {
          continue;
        }

Shouldn't it be ?

        auto callback_group = entity_iter->second.callback_group.lock();
        if (!callback_group || !callback_group->can_be_taken_from()) {
          continue;
        }
jmachowinski commented 3 months ago

@wjwwood @mjcarroll this was changed in #2142

mjcarroll commented 3 months ago

You are correct, and the ones that follow are also incorrect, I will patch.

Good catch!

jmachowinski commented 2 months ago

fixed