-
Notifications
You must be signed in to change notification settings - Fork 512
Support to configure feedback subscription content filter for action client #3034
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
Open
Barry-Xu-2018
wants to merge
5
commits into
ros2:rolling
Choose a base branch
from
Barry-Xu-2018:develop/topic-configure-feedback-sub-content-filter
base: rolling
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
74f08ea
Support to configure feedback subscription content filter for action …
Barry-Xu-2018 8239e7e
Enhance documentation and add test for action generic client
Barry-Xu-2018 8f00f78
Optimize the code
Barry-Xu-2018 ce547eb
Update description and add test cases for multiple goals
Barry-Xu-2018 cfaec5b
Improve documentation for action client feedback message optimization
Barry-Xu-2018 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 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -201,7 +201,8 @@ class ClientBase : public rclcpp::Waitable | |
| rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging, | ||
| const std::string & action_name, | ||
| const rosidl_action_type_support_t * type_support, | ||
| const rcl_action_client_options_t & options); | ||
| const rcl_action_client_options_t & options, | ||
| bool enable_feedback_msg_optimization); | ||
|
|
||
| /// Wait for action_server_is_ready() to become true, or until the given timeout is reached. | ||
| RCLCPP_ACTION_PUBLIC | ||
|
|
@@ -295,6 +296,22 @@ class ClientBase : public rclcpp::Waitable | |
| void | ||
| handle_feedback_message(std::shared_ptr<void> message) = 0; | ||
|
|
||
| /// \internal | ||
| /// \return true if goal id was added to feedback subscription content filter successfully | ||
| /// \return false if an error occurred during calling rcl function or | ||
| /// if the used rmw middleware doesn't support Content Filtering feature. | ||
| bool | ||
| configure_feedback_subscription_filter_add_goal_id(const GoalUUID & goal_id); | ||
|
|
||
|
|
||
| /// \internal | ||
| /// \return true if goal id was removed from feedback subscription content filter successfully or | ||
| /// goal id was not found in feedback subscription content filter or | ||
| /// if the used rmw middleware doesn't support Content Filtering feature. | ||
| /// \return false if an error occurred during calling rcl function. | ||
Barry-Xu-2018 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| bool | ||
| configure_feedback_subscription_filter_remove_goal_id(const GoalUUID & goal_id); | ||
|
|
||
| /// \internal | ||
| virtual | ||
| std::shared_ptr<void> | ||
|
|
@@ -322,6 +339,15 @@ class ClientBase : public rclcpp::Waitable | |
| // Storage for std::function callbacks to keep them in scope | ||
| std::unordered_map<EntityType, std::function<void(size_t)>> entity_type_to_on_ready_callback_; | ||
|
|
||
| // Enable feedback subscription content filter | ||
| // Initialization is configured by the user. | ||
| // When an error occurs while adding or removing a goal ID from the content filter, it will | ||
| // automatically be set to false. | ||
| std::atomic_bool enable_feedback_msg_optimization_; | ||
| // Mutex to protect feedback subscription content filter configuration because the related rcl | ||
| // function is not thread-safe. | ||
| std::mutex configure_feedback_sub_content_filter_mutex_; | ||
|
Comment on lines
+347
to
+349
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this need to be recursive mutex?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. A thread cannot re-lock this mutex. |
||
|
|
||
| private: | ||
| std::unique_ptr<ClientBaseImpl> pimpl_; | ||
|
|
||
|
|
||
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
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
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
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
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
Oops, something went wrong.
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.
i am not sure if the user should be aware of this optimization. how about enabling this as best effort underneath, i do not think this does not bring any downside for user application? if user needs to be aware of this, the above explanation should be added more context and information so that user application can make decision if they use it or not.
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.
At first, I didn’t intend to add this parameter, but when certain cases occur (for example, when the goal ID exceeds the limit), error messages are printed out. Users may get confused when they see the error message.
I will add more information on optimization.
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 add more description on optimization.
Please take a look. cfaec5b