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