PCL库安装:
以下是十四讲里的方法:sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all
我执行第一行的时候就没成功,然后就去网上找了一下安装方法。
先安装各种依赖
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 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 libopenni-dev
sudo apt-get install libopenni2-dev
原网址中还有第二步,安装vtk库,不过我没弄
sudo apt-get install libpcl-all
然后测试了十四讲里的代码
mkdir build
cd build
cmake ..
make
此时出现了以下错误:
/usr/bin/ld: cannot find -lvtkproj4
collect2: error: ld returned 1 exit status
CMakeFiles/joinMap.dir/build.make:350: recipe for target ‘joinMap’ failed
make[2]: [joinMap] Error 1
解决办法:
在CMakeList.txt文件里添加:
list(REMOVE_ITEM PCL_LIBRARIES “vtkproj4”)
make成功后:
cd ..
./build/joinMap
这是因为要回到含pose.txt
路径上运行,运行完后会出现 map.pcd
pcl_viewer map.pcd
结果:
来源:CSDN
作者:_YAO阿瑶
链接:https://blog.csdn.net/weixin_44694952/article/details/104417979