Skip to content

Commit

Permalink
Remove max_distance_2_
Browse files Browse the repository at this point in the history
Leave it for other PR
  • Loading branch information
nachovizzo committed Apr 2, 2024
1 parent 36bd666 commit 249e7f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cpp/kiss_icp/core/VoxelHashMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ void VoxelHashMap::RemovePointsFarFromLocation(const Eigen::Vector3d &origin) {
for (auto it = map_.begin(); it != map_.end();) {
const auto &[voxel, voxel_block] = *it;
const auto &pt = voxel_block.points.front();
if ((pt - origin).squaredNorm() > (max_distance2_)) {
const auto max_distance2 = max_distance_ * max_distance_;
if ((pt - origin).squaredNorm() > (max_distance2)) {
it = map_.erase(it);
} else {
++it;
Expand Down
4 changes: 2 additions & 2 deletions cpp/kiss_icp/core/VoxelHashMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct VoxelHashMap {

explicit VoxelHashMap(double voxel_size, double max_distance, int max_points_per_voxel)
: voxel_size_(voxel_size),
max_distance2_(max_distance * max_distance),
max_distance_(max_distance),
max_points_per_voxel_(max_points_per_voxel) {}

inline void Clear() { map_.clear(); }
Expand All @@ -70,7 +70,7 @@ struct VoxelHashMap {
std::vector<Eigen::Vector3d> GetPoints(const std::vector<Voxel> &query_voxels) const;

double voxel_size_;
double max_distance2_;
double max_distance_;
int max_points_per_voxel_;
tsl::robin_map<Voxel, VoxelBlock, VoxelHash> map_;
};
Expand Down

0 comments on commit 249e7f7

Please sign in to comment.