Skip to content
Closed
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 @@ -232,6 +232,9 @@ class BtActionNode : public BT::ActionNodeBase
}

setStatus(BT::NodeStatus::IDLE);
if (goal_handle_) {
goal_handle_.reset();
}
}

protected:
Expand All @@ -242,7 +245,7 @@ class BtActionNode : public BT::ActionNodeBase
bool should_cancel_goal()
{
// Shut the node down if it is currently running
if (status() != BT::NodeStatus::RUNNING) {
if (status() != BT::NodeStatus::RUNNING || !goal_handle_) {
return false;
}

Expand All @@ -266,7 +269,7 @@ class BtActionNode : public BT::ActionNodeBase
// TODO(#1652): a work around until rcl_action interface is updated
// if goal ids are not matched, the older goal call this callback so ignore the result
// if matched, it must be processed (including aborted)
if (this->goal_handle_->get_goal_id() == result.goal_id) {
if (!this->goal_handle_ || (this->goal_handle_->get_goal_id() == result.goal_id)) {
Copy link
Author

Choose a reason for hiding this comment

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

!this->goal_handle_ is if and only if first tick.

goal_result_available_ = true;
result_ = result;
}
Expand Down