-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Modify the BtServiceNode to include an on_success call. #2481
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,16 @@ class BtServiceNode : public BT::ActionNodeBase | |
| { | ||
| } | ||
|
|
||
| /** | ||
|
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. Please add to migration guide a new section on the Galactic page that we added this virtual function to allow for setting of codes after services return 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. Are you referring to this file ? 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. https://github.com/ros-planning/navigation.ros.org/blob/master/migration/Galactic.rst this file, yes for and add changes for a PR would be best |
||
| * @brief Function to perform some user-defined operation upon successful | ||
| * completion of the service. Could put a value on the blackboard. | ||
| * @return BT::NodeStatus Returns SUCCESS by default, user may override to return another value | ||
| */ | ||
| virtual BT::NodeStatus on_completion() | ||
| { | ||
| return BT::NodeStatus::SUCCESS; | ||
| } | ||
|
|
||
| /** | ||
| * @brief Check the future and decide the status of BT | ||
| * @return BT::NodeStatus SUCCESS if future complete before timeout, FAILURE otherwise | ||
|
|
@@ -158,7 +168,8 @@ class BtServiceNode : public BT::ActionNodeBase | |
| rc = callback_group_executor_.spin_until_future_complete(future_result_, server_timeout_); | ||
| if (rc == rclcpp::FutureReturnCode::SUCCESS) { | ||
| request_sent_ = false; | ||
| return BT::NodeStatus::SUCCESS; | ||
| BT::NodeStatus status = on_completion(); | ||
| return status; | ||
| } | ||
|
|
||
| if (rc == rclcpp::FutureReturnCode::TIMEOUT) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.