[Study notes] To programing RGBD-SLAM together from Gaoxiang

本文详细解析了在CMakeLists.txt中遇到的PCL包配置问题,包括如何正确设置PCL_DIR以帮助CMake找到PCLConfig.cmake文件,解决因多线程应用导致的PCL可视化错误,并提供了在ROS Kinetic环境下解决OpenCV和PCL版本冲突的方法。
摘要由CSDN通过智能技术生成
Solve CMake Error in CMakeLists.txt (FIND_PAKAGE):
CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):
  By not providing "FindPCL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "PCL", but
  CMake did not find one.

  Could not find a package configuration file provided by "PCL" with any of
  the following names:

    PCLConfig.cmake
    pcl-config.cmake

  Add the installation prefix of "PCL" to CMAKE_PREFIX_PATH or set "PCL_DIR"
  to a directory containing one of the above files.  If "PCL" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
  • To help cmake find PCLConfig.cmake adding this line if you have installed ROS Kinetic:

set(PCL_DIR "/usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake")

before find_package(PCL 1.3 REQUIRED COMPONENTS common io)

Or run loacate PCLConfig.cmake.


Solve Complile Erorr
.../rgbd-slam-tutorial-gx-master/part IV/src/slamBase.cpp: In function ‘void computeKeyPointsAndDesp(FRAME&, std::__cxx11::string, std::__cxx11::string)’:
.../rgbd-slam-tutorial-gx-master/part IV/src/slamBase.cpp:63:17: error: ‘create’ is not a member of ‘cv::FeatureDetector {aka cv::Feature2D}’
     _detector = cv::FeatureDetector::create( detector.c_str() );
                 ^
.../rgbd-slam-tutorial-gx-master/part IV/src/slamBase.cpp:64:19: error: ‘create’ is not a member of ‘cv::DescriptorExtractor {aka cv::Feature2D}’
     _descriptor = cv::DescriptorExtractor::create( descriptor.c_str() );

Bug fixed: When adding another visualization of pcl::visualization::CloudViewer.
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
visualOdometry: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Aborted (core dumped)

We can see Note in The CloudViewer of pcl documents

The CloudViewer class is NOT meant to be used in multi-threaded applications! Please check the documentation on :pcl:PCLVisualizer<pcl::visualization::PCLVisualizer> or read the PCLVisualizer tutorial for thread safe visualization.

The Viewer window does not be shutdown in visualOdometry.cpp.

To fix this bug: Add two line between } and pcl::io::savePCDFile(...).


References:
PCL Documents: Using PCL in your own project

转载于:https://www.cnblogs.com/williamc17/p/9904011.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值