From 347a746d8ede823b4bad65514e79c802086fe3c5 Mon Sep 17 00:00:00 2001 From: Tasaki-Lab Date: Thu, 25 Jun 2020 10:12:32 +0900 Subject: [PATCH] bug fix about issue #5 Signed-off-by: Tasaki-Lab --- .../nodes/costmap_generator/points_to_costmap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/costmap_generator/nodes/costmap_generator/points_to_costmap.cpp b/costmap_generator/nodes/costmap_generator/points_to_costmap.cpp index 9f7b8f13..6cda6651 100644 --- a/costmap_generator/nodes/costmap_generator/points_to_costmap.cpp +++ b/costmap_generator/nodes/costmap_generator/points_to_costmap.cpp @@ -70,8 +70,8 @@ grid_map::Index PointsToCostmap::fetchGridIndexFromPoint(const pcl::PointXYZ& po double mapped_x = (grid_length_x_ - origin_x_offset - point.x) / grid_resolution_; double mapped_y = (grid_length_y_ - origin_y_offset - point.y) / grid_resolution_; - int mapped_x_ind = std::ceil(mapped_x); - int mapped_y_ind = std::ceil(mapped_y); + int mapped_x_ind = (int)mapped_x; + int mapped_y_ind = (int)mapped_y; grid_map::Index index(mapped_x_ind, mapped_y_ind); return index; }