diff --git a/moveit_planners/stomp/include/stomp_moveit/cost_functions.hpp b/moveit_planners/stomp/include/stomp_moveit/cost_functions.hpp index b910cd3393..97350bec21 100644 --- a/moveit_planners/stomp/include/stomp_moveit/cost_functions.hpp +++ b/moveit_planners/stomp/include/stomp_moveit/cost_functions.hpp @@ -168,7 +168,7 @@ CostFn getCostFunctionFromStateValidator(const StateValidatorFn& state_validator const long kernel_start = mu - static_cast(sigma) * 4; const long kernel_end = mu + static_cast(sigma) * 4; const long bounded_kernel_start = std::max(0l, kernel_start); - const long bounded_kernel_end = std::min(values.cols() - 1, kernel_end); + const long bounded_kernel_end = std::min(static_cast(values.cols()) - 1, kernel_end); for (auto j = bounded_kernel_start; j <= bounded_kernel_end; ++j) { costs(j) = std::exp(-std::pow(j - mu, 2) / (2 * std::pow(sigma, 2))) / (sigma * std::sqrt(2 * M_PI));