Skip to content

Commit

Permalink
We always use frame, if we want to move point_cloud, let's do it in a
Browse files Browse the repository at this point in the history
seprate PR
  • Loading branch information
nachovizzo committed Jul 20, 2024
1 parent eade08f commit 86abc76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cpp/kiss_icp/core/VoxelUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace kiss_icp {

std::vector<Eigen::Vector3d> VoxelDownsample(const std::vector<Eigen::Vector3d> &point_cloud,
std::vector<Eigen::Vector3d> VoxelDownsample(const std::vector<Eigen::Vector3d> &frame,
const double voxel_size) {
tsl::robin_map<Voxel, Eigen::Vector3d> 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});
});
Expand Down
2 changes: 1 addition & 1 deletion cpp/kiss_icp/core/VoxelUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ inline Voxel PointToVoxel(const Eigen::Vector3d &point, const double voxel_size)
static_cast<int>(std::floor(point.z() / voxel_size)));
}
/// Voxelize a point cloud keeping the original coordinates
std::vector<Eigen::Vector3d> VoxelDownsample(const std::vector<Eigen::Vector3d> &point_cloud,
std::vector<Eigen::Vector3d> VoxelDownsample(const std::vector<Eigen::Vector3d> &frame,
const double voxel_size);

} // namespace kiss_icp
Expand Down

0 comments on commit 86abc76

Please sign in to comment.