#ifndef SEMANTIC_MAP_H #define SEMANTIC_MAP_H #include #include #include #include #include #include #include #include #include #include #include #include #include "KeyFrame.h" using namespace std; using namespace cv; // 定义点云使用的格式:这里用的是XYZRGB typedef pcl::PointXYZ PointT; typedef pcl::PointCloud PointCloud; namespace ORB_SLAM2 { class KeyFrame; class Semantic_Map { public: Semantic_Map(const string &strSettingPath); void LoadLabel(const string &strLabelFilename, vector> &vvLabel); void get_bbx(const vector &label1, std::vector &pts, double scale); void Run(); void InsertKeyFrame(KeyFrame *pKF); bool CheckNewKeyFrames(); pcl::PointCloud::Ptr GenratePointCloudMap(KeyFrame *mpCurrentKF, cv::String cloudAddress, cv::String imgadress); pcl::PointCloud::Ptr GenratePointCloudMap(KeyFrame *mpCurrentKF, cv::String cloudAddress, cv::String imgadress, std::vector> vvlabel); void SetPose(Eigen::Isometry3d &T, cv::Mat &Twc); // void SetCurrentKeyFrame(KeyFrame *pkf); void Transform3DPointFromLidarToImage02KITTI(const cv::Mat &x3Dl, cv::Mat &x3Dc, cv::Point2i &point2D, float &d); /**请求终止当前线程 */ void RequestFinish(); /** 当前线程的run函数是否已经终止 */ bool isFinished(); bool CheckFinish(); /** 设置当前线程已经真正地结束了,由本线程run函数调用 */ void SetFinish(); bool Stop(); bool isStopped(); public: // pcl::PointCloud::Ptr mpPointCloud; std::vector mvpointcloud_adress; std::vector mvRGBIMG_adress; std::vector>> mvvvLabel; vector> mvDynamic_label; cv::Mat mRGB; cv::Mat mDepth; cv::Mat P2; cv::Mat R0_rect; cv::Mat Tr_velo_to_cam; Mat trans; // Mat p_result; // Mat mimg; float fx, fy, cx, cy, mDepthMapFactor; // cv::Mat Twc; std::vector mlpSemanticKeyFrameQueue; // KeyFrame *mpCurrentKF; // PointCloud::Ptr mpPointCloud; std::mutex mMutexSemanticQueue; /// 当前线程是否收到了请求终止的信号 bool mbFinishRequested; /// 当前线程的主函数是否已经终止 bool mbFinished; // 和"线程真正结束"有关的互斥锁 std::mutex mMutexFinish; }; } #endif