Skip to content

Commit

Permalink
use min instead of multiplication to combine relative and absolute ch…
Browse files Browse the repository at this point in the history
…eck (moveit#3556)
  • Loading branch information
simonschmeisser committed Jan 26, 2024
1 parent 538360c commit 9440572
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions moveit_core/robot_state/src/cartesian_interpolator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,14 @@ double CartesianInterpolator::checkJointSpaceJump(const JointModelGroup* group,
return percentage_solved;

if (jump_threshold.factor > 0.0)
percentage_solved *= checkRelativeJointSpaceJump(group, traj, jump_threshold.factor);
percentage_solved = checkRelativeJointSpaceJump(group, traj, jump_threshold.factor);

double percentage_solved_absolute = 1.0;
if (jump_threshold.revolute > 0.0 || jump_threshold.prismatic > 0.0)
percentage_solved *= checkAbsoluteJointSpaceJump(group, traj, jump_threshold.revolute, jump_threshold.prismatic);
percentage_solved_absolute =
checkAbsoluteJointSpaceJump(group, traj, jump_threshold.revolute, jump_threshold.prismatic);

return percentage_solved;
return std::min(percentage_solved, percentage_solved_absolute);
}

double CartesianInterpolator::checkRelativeJointSpaceJump(const JointModelGroup* group,
Expand Down

0 comments on commit 9440572

Please sign in to comment.