Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ class BtServiceNode : public BT::ActionNodeBase
{
}

/**
Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you referring to this file ?
Would the best way to edit it be to create a fork and than PR the changes ?

Copy link
Member

@SteveMacenski SteveMacenski Jul 28, 2021

Choose a reason for hiding this comment

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

* @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
Expand All @@ -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) {
Expand Down