-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ServiceClient use callback group #2216
Merged
SteveMacenski
merged 8 commits into
ros-navigation:main
from
wyca-robotics:service_client_use_callback_group
Mar 9, 2021
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
729c637
change timeout default value
b859845
create and use callback group
41412a1
remove generate_internal_node option
c9cda89
unit test to do a service call in a topic callback
d56aa18
Merge remote-tracking branch 'ros-planning/main' into service_client_…
4c29ac9
fix unit test
edde26f
Merge remote-tracking branch 'ros-planning/main' into service_client_…
9b1b2dd
set default value to -1
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is me asking a question because I haven't used callback groups like this before (previously in the context of priorities only):
I see the second argument means whether to add it to the node's executor or not. Why do you need to run it against a separate executor if its in another callback group? Wouldn't the
MutuallyExclusive
callback group type make it so that it could be processed at the same time as other callbacks in the same executor?Basing this question on this comment: https://github.com/ros2/rclcpp/blob/master/rclcpp/include/rclcpp/callback_group.hpp#L69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done some digging, is the reason that doesn't work because the executor being run right now is single threaded? So you're using a second single threaded executor to execute this callback group separately due to the lack of multithreaded executor?
Edit: I've found that the default callback group when not set is MutuallyExclusive single threaded executor, so if you added this to the existing one, then it wouldn't work because it was already blocked. It seems odd to me to have an internal executor - but I think this is OK from that research. Any significan toverhead associated with just an orphaned executor over here for just this object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second argument will automatically add the callback group to the node executor.
Hence, you need to change the way you spin your nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
MutuallyExclusive
, only the callbacks in the same callback group are mutually exclusive. If you create a callback group per client, there are not blocking each other.