/home/sun/slam/YOLO_ORB_SLAM3_Dense/include/PointCloudMapper.h:41:29: error:
‘typedef class boost::shared_ptr<pcl::VoxelGrid<pcl::PointXYZRGB> >
pcl::VoxelGrid<pcl::PointXYZRGB>::Ptr’ is protected within this context
pcl::VoxelGrid<PointT>::Ptr mpVoxel;
PointCloudMapper.h原代码:
//
//
#ifndef ORB_SLAM3_POINTCLOUDMAPPER_H
#define ORB_SLAM3_POINTCLOUDMAPPER_H
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <Eigen/Geometry>
#include <boost/format.hpp>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/filters/voxel_grid.h>
#include "KeyFrame.h"
#include <pcl/common/transforms.h>
using namespace ORB_SLAM3;
using namespace std;
typedef pcl::PointXYZRGB PointT;
typedef pcl::PointCloud<PointT> PointCloud;
class PointCloudMapper
{
public:
PointCloudMapper();
void InsertKeyFrame(KeyFrame* kf, cv::Mat& imRGB, cv::Mat& imDepth);
PointCloud::Ptr GeneratePointCloud(KeyFrame* kf, cv::Mat& imRGB, cv::Mat& imDepth);
void run();
queue<KeyFrame*> mqKeyFrame;
queue<cv::Mat> mqRGB;
queue<cv::Mat> mqDepth;
pcl::VoxelGrid<PointT>::Ptr mpVoxel;
std::mutex mmLoadKFMutex;
PointCloud::Ptr mpGlobalMap;
int mKeyFrameSize;
};
#endif //ORB_SLAM3_POINTCLOUDMAPPER_H
改为:
//
//
#ifndef ORB_SLAM3_POINTCLOUDMAPPER_H
#define ORB_SLAM3_POINTCLOUDMAPPER_H
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <Eigen/Geometry>
#include <boost/format.hpp>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/filters/voxel_grid.h>
#include "KeyFrame.h"
#include <pcl/common/transforms.h>
#include <memory>
#include <mutex> // For std::mutex
#include <queue> // For std::queue
using namespace ORB_SLAM3;
using namespace std;
typedef pcl::PointXYZRGB PointT;
typedef pcl::PointCloud<PointT> PointCloud;
class PointCloudMapper
{
public:
PointCloudMapper();
void InsertKeyFrame(KeyFrame* kf, cv::Mat& imRGB, cv::Mat& imDepth);
PointCloud::Ptr GeneratePointCloud(KeyFrame* kf, cv::Mat& imRGB, cv::Mat& imDepth);
void run();
queue<KeyFrame*> mqKeyFrame;
queue<cv::Mat> mqRGB;
queue<cv::Mat> mqDepth;
std::shared_ptr<pcl::VoxelGrid<PointT>> mpVoxel;
//pcl::VoxelGrid<PointT>::Ptr mpVoxel;
std::mutex mmLoadKFMutex;
PointCloud::Ptr mpGlobalMap;
int mKeyFrameSize;
};
#endif //ORB_SLAM3_POINTCLOUDMAPPER_H