Skip to content

Commit

Permalink
Some renaming for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
tizianoGuadagnino committed Dec 5, 2024
1 parent 6e56ac7 commit a094695
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cpp/kiss_icp/core/VoxelHashMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@

#include <Eigen/Core>
#include <algorithm>
#include <array>
#include <sophus/se3.hpp>
#include <vector>

#include "VoxelUtils.hpp"

namespace {
using kiss_icp::Voxel;
static const std::array<Voxel, 27> shifts{
{{0, 0, 0}, {1, 0, 0}, {-1, 0, 0}, {0, 1, 0}, {0, -1, 0}, {0, 0, 1}, {0, 0, -1},
{1, 1, 0}, {1, -1, 0}, {-1, 1, 0}, {-1, -1, 0}, {1, 0, 1}, {1, 0, -1}, {-1, 0, 1},
{-1, 0, -1}, {0, 1, 1}, {0, 1, -1}, {0, -1, 1}, {0, -1, -1}, {1, 1, 1}, {1, 1, -1},
{1, -1, 1}, {1, -1, -1}, {-1, 1, 1}, {-1, 1, -1}, {-1, -1, 1}, {-1, -1, -1}}};
static const std::array<Voxel, 27> voxel_shifts{
{Voxel{0, 0, 0}, Voxel{1, 0, 0}, Voxel{-1, 0, 0}, Voxel{0, 1, 0}, Voxel{0, -1, 0},
Voxel{0, 0, 1}, Voxel{0, 0, -1}, Voxel{1, 1, 0}, Voxel{1, -1, 0}, Voxel{-1, 1, 0},
Voxel{-1, -1, 0}, Voxel{1, 0, 1}, Voxel{1, 0, -1}, Voxel{-1, 0, 1}, Voxel{-1, 0, -1},
Voxel{0, 1, 1}, Voxel{0, 1, -1}, Voxel{0, -1, 1}, Voxel{0, -1, -1}, Voxel{1, 1, 1},
Voxel{1, 1, -1}, Voxel{1, -1, 1}, Voxel{1, -1, -1}, Voxel{-1, 1, 1}, Voxel{-1, 1, -1},
Voxel{-1, -1, 1}, Voxel{-1, -1, -1}}};
} // namespace

namespace kiss_icp {
Expand All @@ -47,7 +50,7 @@ std::tuple<Eigen::Vector3d, double> VoxelHashMap::GetClosestNeighbor(
// Find the nearest neighbor
Eigen::Vector3d closest_neighbor = Eigen::Vector3d::Zero();
double closest_distance = std::numeric_limits<double>::max();
std::for_each(shifts.cbegin(), shifts.cend(), [&](const auto &voxel_shift) {
std::for_each(voxel_shifts.cbegin(), voxel_shifts.cend(), [&](const auto &voxel_shift) {
const auto &query_voxel = voxel + voxel_shift;
auto search = map_.find(query_voxel);
if (search != map_.end()) {
Expand Down

0 comments on commit a094695

Please sign in to comment.