From 65b5532f786432a8f40f5c3983683ba5bc9dd006 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:53:07 -0500 Subject: [PATCH] Fix passing different types to std::min in cost_functions.hpp (#3244) (#3245) (cherry picked from commit 415a4a2c867bee01a65f1921502350373e4b00ad) Co-authored-by: Silvio Traversaro --- moveit_planners/stomp/include/stomp_moveit/cost_functions.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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));