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

Implement rmw_take_sequence. #221

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

clalancette
Copy link
Collaborator

While this isn't currently used by rclcpp and rclpy, it is used inside of rcl, specifically in testing. Thus we need to implement it to pass all rcl tests.

To reduce code duplication, this commit refactors __rmw_take() to handle this case. In particular, we rename __rmw_take() to __rmw_take_one(), with no error checking. Then we change rmw_take() and rmw_take_with_info() to do the error checking and call __rmw_take_one(). Finally we implement rmw_take_sequence() by calling __rwm_take_one() in a loop.

While this isn't currently used by rclcpp and rclpy,
it *is* used inside of rcl, specifically in testing.  Thus
we need to implement it to pass all rcl tests.

To reduce code duplication, this commit refactors __rmw_take()
to handle this case.  In particular, we rename __rmw_take() to
__rmw_take_one(), with no error checking.  Then we change
rmw_take() and rmw_take_with_info() to do the error checking
and call __rmw_take_one().  Finally we implement rmw_take_sequence()
by calling __rwm_take_one() in a loop.

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette clalancette requested a review from Yadunund June 27, 2024 19:14
Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementations looks great to me!

On a side note: I wonder if there is a way to align the datatypes of thetaken arg in rmw_take_with_info and rmw_take_sequence esp given one is bool * and another as size_t. The latter should be an array of bools imo.

@Yadunund Yadunund merged commit d7243c0 into rolling Jun 28, 2024
7 checks passed
@Yadunund Yadunund deleted the clalancette/implement-rmw-take-sequence branch June 28, 2024 19:33
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

Successfully merging this pull request may close these issues.

2 participants