Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise Voxel functionalities in VoxelHashMap and Preprocessing #362

Merged
merged 13 commits into from
Jul 20, 2024
8 changes: 5 additions & 3 deletions cpp/kiss_icp/core/Preprocessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ std::vector<Eigen::Vector3d> VoxelDownsample(const std::vector<Eigen::Vector3d>
const auto voxel = PointToVoxel(point, voxel_size);
if (!grid.contains(voxel)) grid.insert({voxel, point});
nachovizzo marked this conversation as resolved.
Show resolved Hide resolved
});
std::vector<Eigen::Vector3d> frame_dowsampled(grid.size());
std::transform(grid.cbegin(), grid.cend(), frame_dowsampled.begin(),
[](const auto &voxel_and_point) { return voxel_and_point.second; });
std::vector<Eigen::Vector3d> frame_dowsampled;
frame_dowsampled.reserve(grid.size());
std::for_each(grid.cbegin(), grid.cend(), [&](const auto &voxel_and_point) {
nachovizzo marked this conversation as resolved.
Show resolved Hide resolved
frame_dowsampled.emplace_back(voxel_and_point.second);
});
return frame_dowsampled;
}

Expand Down
Loading