17 #ifndef CARTOGRAPHER_MAPPING_3D_SCAN_MATCHING_INTERPOLATED_GRID_H_ 18 #define CARTOGRAPHER_MAPPING_3D_SCAN_MATCHING_INTERPOLATED_GRID_H_ 25 namespace mapping_3d {
26 namespace scan_matching {
52 double x1, y1, z1, x2, y2, z2;
55 const Eigen::Array3i index1 =
73 const T normalized_x = (x - x1) / (x2 - x1);
74 const T normalized_y = (y - y1) / (y2 - y1);
75 const T normalized_z = (z - z1) / (z2 - z1);
78 const T normalized_xx = normalized_x * normalized_x;
79 const T normalized_xxx = normalized_x * normalized_xx;
80 const T normalized_yy = normalized_y * normalized_y;
81 const T normalized_yyy = normalized_y * normalized_yy;
82 const T normalized_zz = normalized_z * normalized_z;
83 const T normalized_zzz = normalized_z * normalized_zz;
89 const T q11 = (q111 - q112) * normalized_zzz * 2. +
90 (q112 - q111) * normalized_zz * 3. + q111;
91 const T q12 = (q121 - q122) * normalized_zzz * 2. +
92 (q122 - q121) * normalized_zz * 3. + q121;
93 const T q21 = (q211 - q212) * normalized_zzz * 2. +
94 (q212 - q211) * normalized_zz * 3. + q211;
95 const T q22 = (q221 - q222) * normalized_zzz * 2. +
96 (q222 - q221) * normalized_zz * 3. + q221;
97 const T q1 = (q11 - q12) * normalized_yyy * 2. +
98 (q12 - q11) * normalized_yy * 3. + q11;
99 const T q2 = (q21 - q22) * normalized_yyy * 2. +
100 (q22 - q21) * normalized_yy * 3. + q21;
101 return (q1 - q2) * normalized_xxx * 2. + (q2 - q1) * normalized_xx * 3. +
106 template <
typename T>
108 double* x1,
double* y1,
double* z1,
109 double* x2,
double* y2,
124 const double z)
const {
129 if (center.x() > x) {
132 if (center.y() > y) {
135 if (center.z() > z) {
142 template <
typename T>
144 const T& jet_z)
const {
155 #endif // CARTOGRAPHER_MAPPING_3D_SCAN_MATCHING_INTERPOLATED_GRID_H_
Eigen::Vector3f GetCenterOfCell(const Eigen::Array3i &index) const
void ComputeInterpolationDataPoints(const T &x, const T &y, const T &z, double *x1, double *y1, double *z1, double *x2, double *y2, double *z2) const
Eigen::Array3i GetCellIndex(const Eigen::Vector3f &point) const
float GetProbability(const Eigen::Array3i &index) const
Eigen::Vector3f CenterOfLowerVoxel(const T &jet_x, const T &jet_y, const T &jet_z) const
Eigen::Vector3f CenterOfLowerVoxel(const double x, const double y, const double z) const
T GetProbability(const T &x, const T &y, const T &z) const
InterpolatedGrid & operator=(const InterpolatedGrid &)=delete
InterpolatedGrid(const HybridGrid &hybrid_grid)
const HybridGrid & hybrid_grid_