From 8891a53cfbe6202ab4b4916c349d0a09e420b655 Mon Sep 17 00:00:00 2001 From: Steve Macenski Date: Wed, 17 Jan 2024 04:28:18 -0800 Subject: [PATCH] Update collision_checker.cpp Signed-off-by: Steve Macenski --- nav2_smac_planner/src/collision_checker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nav2_smac_planner/src/collision_checker.cpp b/nav2_smac_planner/src/collision_checker.cpp index 20d288809d..328a88f9db 100644 --- a/nav2_smac_planner/src/collision_checker.cpp +++ b/nav2_smac_planner/src/collision_checker.cpp @@ -107,7 +107,7 @@ bool GridCollisionChecker::inCollision( // if footprint, then we check for the footprint's points, but first see // if the robot is even potentially in an inscribed collision footprint_cost_ = costmap_->getCost( - static_cast(x), static_cast(y)); + static_cast(x + 0.5), static_cast(y + 0.5)); if (footprint_cost_ < possible_inscribed_cost_) { if (possible_inscribed_cost_ > 0) { @@ -157,7 +157,7 @@ bool GridCollisionChecker::inCollision( } else { // if radius, then we can check the center of the cost assuming inflation is used footprint_cost_ = costmap_->getCost( - static_cast(x), static_cast(y)); + static_cast(x + 0.5), static_cast(y + 0.5)); if (footprint_cost_ == UNKNOWN && traverse_unknown) { return false;