Skip to content

Commit

Permalink
[OCTREE] Fix the unit 'test_octree'.
Browse files Browse the repository at this point in the history
  • Loading branch information
frozar committed Aug 31, 2017
1 parent 8695e83 commit c00861d
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions octree/include/pcl/octree/impl/octree_pointcloud.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,18 @@ pcl::octree::OctreePointCloud<PointT, LeafContainerT, BranchContainerT, OctreeT>
template<typename PointT, typename LeafContainerT, typename BranchContainerT, typename OctreeT> bool
pcl::octree::OctreePointCloud<PointT, LeafContainerT, BranchContainerT, OctreeT>::isVoxelOccupiedAtPoint (const PointT& point_arg) const
{
if (!isPointWithinBoundingBox (point_arg))
{
return false;
}

OctreeKey key;

// generate key for point
this->genOctreeKeyforPoint (point_arg, key);

// search for key in octree
return (isPointWithinBoundingBox (point_arg) && this->existLeaf (key));
return (this->existLeaf (key));
}

//////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -154,18 +159,25 @@ template<typename PointT, typename LeafContainerT, typename BranchContainerT, ty
pcl::octree::OctreePointCloud<PointT, LeafContainerT, BranchContainerT, OctreeT>::isVoxelOccupiedAtPoint (
const double point_x_arg, const double point_y_arg, const double point_z_arg) const
{
OctreeKey key;

// generate key for point
this->genOctreeKeyforPoint (point_x_arg, point_y_arg, point_z_arg, key);
// create a new point with the argument coordinates
PointT point;
point.x = point_x_arg;
point.y = point_y_arg;
point.z = point_z_arg;

return (this->existLeaf (key));
// search for voxel at point in octree
return (this->isVoxelOccupiedAtPoint (point));
}

//////////////////////////////////////////////////////////////////////////////////////////////
template<typename PointT, typename LeafContainerT, typename BranchContainerT, typename OctreeT> void
pcl::octree::OctreePointCloud<PointT, LeafContainerT, BranchContainerT, OctreeT>::deleteVoxelAtPoint (const PointT& point_arg)
{
if (!isPointWithinBoundingBox (point_arg))
{
return;
}

OctreeKey key;

// generate key for point
Expand Down

0 comments on commit c00861d

Please sign in to comment.