execute_task_solution_capability: check for canceling request before canceling the goal handle (#321)

This commit is contained in:
Jafar Abdi 2021-12-22 16:13:36 +03:00 committed by GitHub
parent 98ced788c8
commit 3a30e498bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,7 +119,7 @@ void ExecuteTaskSolutionCapability::goalCallback(
if (result->error_code.val == moveit_msgs::msg::MoveItErrorCodes::SUCCESS)
goal_handle->succeed(result);
else if (result->error_code.val == moveit_msgs::msg::MoveItErrorCodes::PREEMPTED)
else if (result->error_code.val == moveit_msgs::msg::MoveItErrorCodes::PREEMPTED && goal_handle->is_canceling())
goal_handle->canceled(result);
else
goal_handle->abort(result);