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

Fix checking of the guard condition. #204

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

clalancette
Copy link
Collaborator

Previously, when we were checking if a guard condition was triggered, we would actually check and reset it. But that means that when we later on went to set the appropriate things in the wait_set, we wouldn't actually set the guard_condition true, since it was false by that point.

Instead, add in two separate methods; the one that just returns whether it is triggered, which we call when checking, and the one that checks and resets, which we call when setting it in the wait_set.

@clalancette clalancette requested a review from Yadunund June 20, 2024 21:30
Previously, when we were checking if a guard condition
was triggered, we would actually check and reset it.
But that means that when we later on went to set the
appropriate things in the wait_set, we wouldn't actually
set the guard_condition true, since it was false by that point.

Instead, add in two separate methods; the one that just
returns whether it is triggered, which we call when checking,
and the one that checks and resets, which we call when
setting it in the wait_set.

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette clalancette force-pushed the clalancette/fix-guard-condition branch from 1a2d40a to fb24401 Compare June 20, 2024 21:31
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.

Thanks for updating this! I hope you don't mind this push d830d6f.

@@ -3143,14 +3143,12 @@ static bool has_triggered_condition(
rmw_clients_t * clients,
rmw_events_t * events)
{
static_cast<void>(events);
Copy link
Member

Choose a reason for hiding this comment

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

wow does this mean we were never actually checking for events?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, the code for checking events is down below. We just forgot to remove this (dead) line of code when we actually did implement events.

@Yadunund Yadunund merged commit 7609e41 into rolling Jun 21, 2024
7 checks passed
@Yadunund Yadunund deleted the clalancette/fix-guard-condition branch June 21, 2024 02:03
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