From 292550df0148e49150a07c28d39ada8f4824e648 Mon Sep 17 00:00:00 2001 From: Kenzo Lobos Tsunekawa Date: Thu, 23 Jan 2025 20:39:25 +0900 Subject: [PATCH 1/3] Update perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu Co-authored-by: Yoshi Ri --- .../lib/updater/log_odds_bayes_filter_updater_kernel.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu b/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu index 74848bcd7b23e..ba96ea0599745 100644 --- a/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu +++ b/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu @@ -33,7 +33,7 @@ __host__ __device__ __forceinline__ double convertCharToProbability(const std::u __host__ __device__ __forceinline__ std::uint8_t convertProbabilityToChar(const double value) { - return static_cast(value * 255.0); + return static_cast(std::max(0.0, std::min(1.0, value)) * 255.0);; } __host__ __device__ __forceinline__ double logOddsFusion(const double p1, const double p2) From 4ef247ae22ef381e1edbf5fef43b66902fb514c4 Mon Sep 17 00:00:00 2001 From: Kenzo Lobos Tsunekawa Date: Thu, 23 Jan 2025 20:41:46 +0900 Subject: [PATCH 2/3] Update perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu Co-authored-by: Yoshi Ri --- .../lib/updater/log_odds_bayes_filter_updater_kernel.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu b/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu index ba96ea0599745..08f96116392b8 100644 --- a/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu +++ b/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu @@ -43,7 +43,7 @@ __host__ __device__ __forceinline__ double logOddsFusion(const double p1, const const double p1_norm = std::max(EPSILON_PROB, std::min(1.0 - EPSILON_PROB, p1)); log_odds += std::log(p1_norm / (1.0 - p1_norm)); - const double p2_norm = std::max(EPSILON_PROB, std::min(1.0 - EPSILON_PROB, p1)); + const double p2_norm = std::max(EPSILON_PROB, std::min(1.0 - EPSILON_PROB, p2)); log_odds += std::log(p2_norm / (1.0 - p2_norm)); return 1.0 / (1.0 + std::exp(-log_odds)); From a33d3d97cb37d5f2f57fc492fbe8102d90b6f30f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:42:04 +0000 Subject: [PATCH 3/3] style(pre-commit): autofix --- .../lib/updater/log_odds_bayes_filter_updater_kernel.cu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu b/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu index 08f96116392b8..16705adac31b9 100644 --- a/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu +++ b/perception/autoware_probabilistic_occupancy_grid_map/lib/updater/log_odds_bayes_filter_updater_kernel.cu @@ -33,7 +33,8 @@ __host__ __device__ __forceinline__ double convertCharToProbability(const std::u __host__ __device__ __forceinline__ std::uint8_t convertProbabilityToChar(const double value) { - return static_cast(std::max(0.0, std::min(1.0, value)) * 255.0);; + return static_cast(std::max(0.0, std::min(1.0, value)) * 255.0); + ; } __host__ __device__ __forceinline__ double logOddsFusion(const double p1, const double p2)