Skip to content

Commit 6fb20ee

Browse files
author
Gaël Écorchard
committed
Simplify ModelBasedPlanningContext::solve()
Signed-off-by: Gaël Écorchard <gael@km-robotics.cz>
1 parent 2ee7ac4 commit 6fb20ee

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

moveit_planners/ompl/ompl_interface/src/model_based_planning_context.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -800,12 +800,10 @@ void ModelBasedPlanningContext::solve(planning_interface::MotionPlanResponse& re
800800

801801
void ModelBasedPlanningContext::solve(planning_interface::MotionPlanDetailedResponse& res)
802802
{
803-
moveit_msgs::msg::MoveItErrorCodes moveit_result =
804-
solve(request_.allowed_planning_time, request_.num_planning_attempts);
805-
if (moveit_result.val != moveit_msgs::msg::MoveItErrorCodes::SUCCESS)
803+
res.error_code = solve(request_.allowed_planning_time, request_.num_planning_attempts);
804+
if (res.error_code.val != moveit_msgs::msg::MoveItErrorCodes::SUCCESS)
806805
{
807806
RCLCPP_INFO(getLogger(), "Unable to solve the planning problem");
808-
res.error_code = moveit_result;
809807
return;
810808
}
811809

@@ -843,7 +841,6 @@ void ModelBasedPlanningContext::solve(planning_interface::MotionPlanDetailedResp
843841

844842
RCLCPP_DEBUG(getLogger(), "%s: Returning successful solution with %lu states", getName().c_str(),
845843
getOMPLSimpleSetup()->getSolutionPath().getStateCount());
846-
res.error_code.val = moveit_result.val;
847844
}
848845

849846
const moveit_msgs::msg::MoveItErrorCodes ModelBasedPlanningContext::solve(double timeout, unsigned int count)

0 commit comments

Comments
 (0)