Skip to content

Commit

Permalink
Fix potential segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyZe committed Dec 15, 2022
1 parent 723fef7 commit 43179d8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions moveit_core/trajectory_processing/src/ruckig_traj_smoothing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ bool RuckigSmoothing::applySmoothing(robot_trajectory::RobotTrajectory& trajecto
}

auto ruckig_result = runRuckigInBatches(num_waypoints, trajectory, ruckig_input);
trajectory = ruckig_result.value();
return ruckig_result.has_value();
if (ruckig_result.has_value())
{
trajectory = ruckig_result.value();
}
return ruckig_result.has_value(); // Ruckig failed to smooth the trajectory
}

bool RuckigSmoothing::applySmoothing(robot_trajectory::RobotTrajectory& trajectory,
Expand Down Expand Up @@ -142,8 +145,11 @@ bool RuckigSmoothing::applySmoothing(robot_trajectory::RobotTrajectory& trajecto
}

auto ruckig_result = runRuckigInBatches(num_waypoints, trajectory, ruckig_input);
trajectory = ruckig_result.value();
return ruckig_result.has_value();
if (ruckig_result.has_value())
{
trajectory = ruckig_result.value();
}
return ruckig_result.has_value(); // Ruckig failed to smooth the trajectory
}

std::optional<robot_trajectory::RobotTrajectory>
Expand Down

0 comments on commit 43179d8

Please sign in to comment.