24 #include "glog/logging.h" 27 namespace mapping_3d {
28 namespace scan_matching {
35 inline int DivideByTwoRoundingTowardsNegativeInfinity(
const int value) {
41 Eigen::Array3i CellIndexAtHalfResolution(
const Eigen::Array3i& cell_index) {
42 return Eigen::Array3i(
43 DivideByTwoRoundingTowardsNegativeInfinity(cell_index[0]),
44 DivideByTwoRoundingTowardsNegativeInfinity(cell_index[1]),
45 DivideByTwoRoundingTowardsNegativeInfinity(cell_index[2]));
57 CHECK_GE(cell_value, 0);
58 CHECK_LE(cell_value, 255);
59 *result.mutable_value(it.GetCellIndex()) = cell_value;
65 const bool half_resolution,
66 const Eigen::Array3i& shift) {
69 for (
int i = 0; i != 8; ++i) {
74 const Eigen::Array3i cell_index =
76 auto*
const cell_value = result.mutable_value(
77 half_resolution ? CellIndexAtHalfResolution(cell_index) : cell_index);
78 *cell_value = std::max(it.GetValue(), *cell_value);
Eigen::Array3i GetCellIndex(const Eigen::Vector3f &point) const
int RoundToInt(const float x)
constexpr float kMinProbability
float ValueToProbability(const uint16 value)
constexpr float kMaxProbability
PrecomputationGrid PrecomputeGrid(const PrecomputationGrid &grid, const bool half_resolution, const Eigen::Array3i &shift)
static Eigen::Array3i GetOctant(const int i)
PrecomputationGrid ConvertToPrecomputationGrid(const HybridGrid &hybrid_grid)