PCL1.8+Ubuntu16.04安装详解以及运行时遇到的一些错误

方式一:官网prebuild版本

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all
可能是因为国内的关系,并没有更新 apt-get 成功

方式二:安装 prebuilt DEB file for PCL 1.8 for Ubunut 16.04

DEB-FILE

会报错没有相关依赖,解决方式: 

sudo apt-get -f update


方式三:自己编译源码(推荐)

以上两种便捷方式在之后的使用中我都出现了一些问题,所以还是推荐自己编译。

第一步:安装依赖

      sudo apt-get update  
    sudo apt-get install git build-essential linux-libc-dev  
    sudo apt-get install cmake cmake-gui   
    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.8 libflann-dev  
    sudo apt-get install libeigen3-dev  
    sudo apt-get install libboost-all-dev  
    sudo apt-get install libvtk5.10-qt4 libvtk5.10 libvtk5-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  
    sudo apt-get install qt-sdk openjdk-8-jdk openjdk-8-jre  

此时运行的过程中,需要确认“需要确认是否执行‘Y/n’”,个人在时间的过程中,时而直接enter,时而输入Y才可以。

第二步:下载源码

git clone https://github.com/PointCloudLibrary/pcl.git

第三步:编译源码
    cd pcl  
    mkdir release  
    cd release  
    cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \  
          -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \  
          -DCMAKE_INSTALL_PREFIX=/usr ..  
    make  
sudo make install 
第四步(可选 and 建议):如果需要PCLVisualizer

安装OpenNI、OpenNI2

    sudo apt-get install libopenni-dev   
    sudo apt-get install libopenni2-dev  

安装ensensor

下载

sudo dpkg -i ensenso-sdk-2.0.147-x64.deb 
sudo dpkg -i codemeter_6.40.2402.501_amd64.deb


如缺少依赖:sudo apt-get -f install


Done!以上安装步骤就完成了,但是在运行过程中遇到如下问题:


运行测试程序时出现以下错误

make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libproj.so', needed by 'joinMap'.  Stop.

CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/joinMap.dir/all' failed
make[1]: *** [CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

*** Failure: Exit code 2 ***

解决方法,执行

sudo apt-get install libproj-dev


再次编译出现以下错误

-- Build files have been written to: /home/wd/code/slambook-master/ch5/joinMap/build
[ 50%] Linking CXX executable joinMap
/usr/bin/ld: cannot find -lvtkproj4
collect2: error: ld returned 1 exit status
CMakeFiles/joinMap.dir/build.make:349: recipe for target 'joinMap' failed
make[2]: *** [joinMap] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/joinMap.dir/all' failed
make[1]: *** [CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
*** Failure: Exit code 2 ***

解决方法,需要在cmakelist中加一条指令修复,即在add_executable语句前面加上list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")



转自:http://blog.csdn.net/dantengc/article/details/78446600

http://blog.csdn.net/danmeng8068/article/details/77341532

你可能感兴趣的:(SLAM练习笔记)