Skip to content

Commit 64c3d6c

Browse files
committed
Preserve planner-specific MoveGroup failure codes
1 parent 848c062 commit 64c3d6c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

moveit_ros/move_group/src/default_capabilities/move_action_capability.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,17 @@ void MoveGroupMoveAction::executeMoveCallbackPlanOnly(const std::shared_ptr<MGAc
218218
if (!planning_pipeline->generatePlan(scene, goal->get_goal()->request, res, context_->debug_))
219219
{
220220
RCLCPP_ERROR(getLogger(), "Generating a plan with planning pipeline failed.");
221-
res.error_code.val = moveit_msgs::msg::MoveItErrorCodes::FAILURE;
221+
if (res.error_code.val == moveit_msgs::msg::MoveItErrorCodes::SUCCESS ||
222+
res.error_code.val == moveit_msgs::msg::MoveItErrorCodes::UNDEFINED)
223+
{
224+
res.error_code.val = moveit_msgs::msg::MoveItErrorCodes::FAILURE;
225+
}
226+
else
227+
{
228+
RCLCPP_ERROR(
229+
getLogger(), "Preserving planner-specific failure code %d for /move_action",
230+
res.error_code.val);
231+
}
222232
}
223233
}
224234
catch (std::exception& ex)

0 commit comments

Comments
 (0)