26 #ifndef TESSERACT_GEOMETRY_OCTREE_UTILS_H
27 #define TESSERACT_GEOMETRY_OCTREE_UTILS_H
31 #include <octomap/OcTree.h>
45 Point(
double x_,
double y_,
double z_) :
x(x_),
y(y_),
z(z_) {}
54 void addPoint(
double x,
double y,
double z) {
points.emplace_back(x, y, z); }
57 template <
typename Po
intT>
58 std::unique_ptr<octomap::OcTree>
59 createOctree(
const PointT& point_cloud,
const double resolution,
const bool prune,
const bool binary =
true)
61 auto ot = std::make_unique<octomap::OcTree>(resolution);
63 for (
auto& point : point_cloud.points)
64 ot->updateNode(point.x, point.y, point.z,
true,
true);
68 ot->updateInnerOccupancy();
70 ot->toMaxLikelihood();
78 #endif // TESSERACT_GEOMETRY_OCTREE_UTILS_H