Skip to content

Commit

Permalink
a workaround patch for ros-navigation#1652
Browse files Browse the repository at this point in the history
Signed-off-by: Daisuke Sato <[email protected]>
  • Loading branch information
daisukes committed Jun 18, 2020
1 parent fd2955a commit 6a8197a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ class BtActionNode : public BT::ActionNodeBase
auto send_goal_options = typename rclcpp_action::Client<ActionT>::SendGoalOptions();
send_goal_options.result_callback =
[this](const typename rclcpp_action::ClientGoalHandle<ActionT>::WrappedResult & result) {
if (result.code != rclcpp_action::ResultCode::ABORTED) {
// TODO(#1652): a work around until rcl_action interface is updated
// if goal ids are not matched, the older goal is aborted by preemption so ignore the result
// if matched, goal is aborted in other reason so it must be processed
if (this->goal_handle_->get_goal_id() == result.goal_id) {
goal_result_available_ = true;
result_ = result;
}
Expand Down Expand Up @@ -249,6 +252,7 @@ class BtActionNode : public BT::ActionNodeBase
typename ActionT::Goal goal_;
bool goal_updated_{false};
bool goal_result_available_{false};

typename rclcpp_action::ClientGoalHandle<ActionT>::SharedPtr goal_handle_;
typename rclcpp_action::ClientGoalHandle<ActionT>::WrappedResult result_;

Expand Down

0 comments on commit 6a8197a

Please sign in to comment.