Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventHandlerBase::get_number_of_ready_events() does not compute number of ready events #2716

Open
Yadunund opened this issue Dec 27, 2024 · 0 comments
Assignees

Comments

@Yadunund
Copy link
Member

Feature request

Feature description

The current implementation of EventHandlerBase::get_number_of_ready_events() always returns 1. This function was originally introduced in #695 and is only used in rclcpp/test_qos_event.

However, having an accurate implementation of this function could benefit other tests like test_publisher:run_event_handlers which is calling take_data() without checking if the event is ready (ie, not calling is_ready()) or if get_number_of_ready_events > 0.

Implementation considerations

To correctly compute the number of ready events, we would likely need to

  • Add a method to rmw/event.h to retrieve the count of events for a given rmw_event_type_t.
  • Add a methods to rcl/event.h to retrieve number of ready events of publishers and subscriptions resp. given an rcl_event_t handle. This method will in turn invoke the newly introduced rmw method above.

Then the implementation for EventHandlerBase::get_number_of_ready_events() can be updated to invoke the appropriate rcl methods added above.

If this approach sounds ok, I can work on the implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants