在使用CLion时,使用pcl八叉树获得根结点时,最后一行报错。
float resolution = 0.01f;
pcl::octree::OctreePointCloud<pcl::PointXYZ> octree(resolution);
octree.setInputCloud(cloud);
octree.addPointsFromInputCloud();
// 获取根节点
pcl::octree::OctreeNode* root = octree.getRootNode();
报错
'getRootNode' is a protected member of 'pcl::octree::OctreeBase<pcl::octree::OctreeContainerPointIndices>'
但是pcl::octree::OctreePointCloud<pcl::PointXYZ>
是pcl::octree::OctreeBase<pcl::octree::OctreeContainerPointIndices>
的子类,为什么子类对象无法访问到父类中受保护的方法?