Permalink
Browse files

Invalid cast to LeafNode* in OctreePointCloudVoxelCentroid

Closes #960. Credits to @ThomasGuerneve for the original PR.
  • Loading branch information...
1 parent d34e5a9 commit c38523a5a83b3de12cc549258a3ea5501e05639d @SergioRAgostinho SergioRAgostinho committed Aug 26, 2016
Showing with 3 additions and 7 deletions.
  1. +3 −7 octree/include/pcl/octree/impl/octree_pointcloud_voxelcentroid.hpp
@@ -48,20 +48,16 @@ pcl::octree::OctreePointCloudVoxelCentroid<PointT, LeafContainerT, BranchContain
const PointT& point_arg, PointT& voxel_centroid_arg) const
{
OctreeKey key;
- LeafNode* leaf = 0;
+ LeafContainerT* leaf = NULL;
// generate key
genOctreeKeyforPoint (point_arg, key);
leaf = this->findLeaf (key);
-
if (leaf)
- {
- LeafContainerT* container = leaf;
- container->getCentroid (voxel_centroid_arg);
- }
+ leaf->getCentroid (voxel_centroid_arg);
- return (leaf != 0);
+ return (leaf != NULL);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 comments on commit c38523a

Please sign in to comment.