Linux安装PCL库

开发环境 同时被 2 个专栏收录
7 篇文章 0 订阅
1 篇文章 0 订阅
  1. 记录安装PCL库(point cloud library),参考PCL官网3DSmoothNet项目这里
  2. 先挑选了官网列的几项必装项安装,也能编译安装上PCL,但是基于Pybind11的3DSmoothNet(依赖于PCL)编译后的.so文件无法导入python,最后检查,猜测还是PCL安装依赖的问题,遂卸载PCL重装。以防万一,将上述链接中提到的依赖取并集,尽量都装上。
# Notes for PCL installation, 
# 1. subset dependencies
# sudo apt-get update
# sudo apt-get install g++                  # skip if already has
# sudo apt-get install cmake                # skip is already has
# sudo apt-get install libboost-all-dev     # Boost is strictly REQUIRED
# sudo apt-get install libeigen3-dev        # Eigen is strictly REQUIRED
# sudo apt-get install libflann-dev         # FLANN is strictly REQUIRED
# sudo apt-get install libvtk6-dev          # VTK is for pcl_visualization
# sudo apt-get install 'libqhull*'          # Qhull is for cl_surface
# sudo apt-get install libopenni2-dev       # OpenNI is for pcl_io

# 2. all dependencies
sudo apt-get update  
sudo apt-get install build-essential linux-libc-dev libxmu-dev libxi-dev
sudo apt-get install cmake cmake-gui
sudo apt-get install doxygen
sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev
sudo apt-get install mpi-default-dev openmpi-bin openmpi-common 
sudo apt-get install libflann1.9 libflann-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libvtk7.1-qt
sudo apt-get install libvtk7.1 
sudo apt-get install libvtk7-jni libvtk7-java libvtk7-dev libvtk7-qt-dev
sudo apt-get install libqhull* libgtest-dev
sudo apt-get install freeglut3-dev pkg-config
sudo apt-get install libxmu-dev libxi-dev
sudo apt-get install mono-complete graphviz
sudo apt-get install openjdk-8-jdk openjdk-8-jre	# 无法安装qt-sdk openjdk-9-jdk openjdk-9-jre
sudo apt-get install libopenni-dev libopenni2-dev
sudo apt-get install phonon-backend-gstreamer
sudo apt-get install phonon-backend-vlc


# 2. install PCL
#git clone --branch pcl-1.8.1 https://github.com/PointCloudLibrary/pcl pcl-trunk
# ln -s pcl-trunk pcl
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=None -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON ..
make -j 8
sudo make install

# 3. uninstall PCL
sudo rm -r /usr/local/include/pcl-1.8 /usr/local/share/pcl-1.8 /usr/local/bin/pcl* /usr/local/lib/libpcl*

  1. 编译时报了若干错误:

    1. Could NOT find ClangFormat…
    2. Could NOT find Ensenso…
    3. Could NOT find davidSDK…
    4. Could NOT find DSSDK…
    5. Could NOT find RSSDK…
    6. Could NOT find RSSDK2…
    7. No package ‘metslib’ found…
    8. Could NOT find Pcap…
  2. 部分问题的解决方案:

    1. 安装ensenso [ref]
    sudo dpkg -i ensenso-sdk-2.2.147-x64.deb   		# https://www.ensenso.com/support/sdk-download/
    sudo dpkg -i codemeter_6.80.3312.500_amd64.deb  # https://www.wibu.com/support/user/downloads-user-software.html
    
    1. 安装metslib
    sudo sh ./configure
    sudo make
    sudo make install
    
  3. 验证安装

    cd /your_path_to_downloaded_pcl_repo/pcl/test
    pcl_viewer car6.pcd
    
  4. 编译用到PCL的文件

    1. 碰到形如下面的错误,检查是否有头文件没有被include
      error: ‘PointXYZ’ is not a member of ‘pcl’...
      
    2. 关于PCL的错误
      The imported target "vtkRenderingPythonTkWidgets" references the file
         "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so" but this file does not exist....
      
      The imported target "vtk" references the file "/usr/bin/vtk" but this file does not exist.
      
      手动建立软链接(创建后可以检查一下,防止出现“标红”的快捷方式)
      sudo ln -s /usr/lib/python2.7/dist-packages/vtk/libvtkRenderingPythonTkWidgets.x86_64-linux-gnu.so /usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so
      sudo ln -s /usr/bin/vtk7 /usr/bin/vtk
      
    3. 还有下面的WARNING,暂不予处理 — ref
      ** WARNING ** io features related to pcap will be disabled
      ** WARNING ** io features related to png will be disabled
      
  • 0
    点赞
  • 0
    评论
  • 3
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值