Proper spin_some behaviour on EventsExecutor#46
Merged
irobot-ros merged 4 commits intoirobot-ros:irobot/add-events-executorfrom Feb 19, 2021
Merged
Conversation
irobot-ros
reviewed
Feb 19, 2021
irobot-ros
reviewed
Feb 19, 2021
irobot-ros
reviewed
Feb 19, 2021
irobot-ros
reviewed
Feb 19, 2021
irobot-ros
reviewed
Feb 19, 2021
irobot-ros
reviewed
Feb 19, 2021
irobot-ros
reviewed
Feb 19, 2021
| auto timepoint_timer_ready = std::chrono::steady_clock::now() + head->time_until_trigger(); | ||
|
|
||
| // Here we check if the timer was already ready at timepoint | ||
| timer_ready = timepoint_timer_ready < timepoint; |
Collaborator
There was a problem hiding this comment.
there is already a function that performs this check: timer_was_ready_at_tp
irobot-ros
reviewed
Feb 19, 2021
| // See https://en.cppreference.com/w/cpp/thread/condition_variable/wait_for | ||
| static constexpr std::chrono::nanoseconds MAX_TIME = std::chrono::hours(90); | ||
|
|
||
| using TimePoint = std::chrono::time_point<std::chrono::steady_clock>; |
Collaborator
There was a problem hiding this comment.
this should not be public
moreover, if you want to use an alias, you should replace it in all the functions
irobot-ros
reviewed
Feb 19, 2021
| */ | ||
| bool execute_head_timer(); | ||
| bool execute_head_timer( | ||
| std::chrono::time_point<std::chrono::steady_clock> tp = TimePoint::max()); |
Collaborator
There was a problem hiding this comment.
the signature of this function is not correct because std::chrono::time_point<std::chrono::steady_clock> and TimePoint may be different types.
irobot-ros
approved these changes
Feb 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.