From 86abc768ebb0e627a21e91ff2aae1407e038627d Mon Sep 17 00:00:00 2001 From: Ignacio Vizzo Date: Sat, 20 Jul 2024 09:33:17 +0100 Subject: [PATCH] We always use frame, if we want to move point_cloud, let's do it in a seprate PR --- cpp/kiss_icp/core/VoxelUtils.cpp | 6 +++--- cpp/kiss_icp/core/VoxelUtils.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/kiss_icp/core/VoxelUtils.cpp b/cpp/kiss_icp/core/VoxelUtils.cpp index 683d53aa..f8f8ea8c 100644 --- a/cpp/kiss_icp/core/VoxelUtils.cpp +++ b/cpp/kiss_icp/core/VoxelUtils.cpp @@ -4,11 +4,11 @@ namespace kiss_icp { -std::vector VoxelDownsample(const std::vector &point_cloud, +std::vector VoxelDownsample(const std::vector &frame, const double voxel_size) { tsl::robin_map grid; - grid.reserve(point_cloud.size()); - std::for_each(point_cloud.cbegin(), point_cloud.cend(), [&](const auto &point) { + grid.reserve(frame.size()); + std::for_each(frame.cbegin(), frame.cend(), [&](const auto &point) { const auto voxel = PointToVoxel(point, voxel_size); if (!grid.contains(voxel)) grid.insert({voxel, point}); }); diff --git a/cpp/kiss_icp/core/VoxelUtils.hpp b/cpp/kiss_icp/core/VoxelUtils.hpp index b0e06626..fee257a9 100644 --- a/cpp/kiss_icp/core/VoxelUtils.hpp +++ b/cpp/kiss_icp/core/VoxelUtils.hpp @@ -35,7 +35,7 @@ inline Voxel PointToVoxel(const Eigen::Vector3d &point, const double voxel_size) static_cast(std::floor(point.z() / voxel_size))); } /// Voxelize a point cloud keeping the original coordinates -std::vector VoxelDownsample(const std::vector &point_cloud, +std::vector VoxelDownsample(const std::vector &frame, const double voxel_size); } // namespace kiss_icp