1.安装依赖
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 libvtk7.1-qt libvtk7.1 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
sudo apt-get install openjdk-8-jdk openjdk-8-jre
2.下载pcl
git clone https://github.com/PointCloudLibrary/pcl.git
3.编译pcl
cd pcl
mkdir build
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
4.验证是否安装成功
打开终端,用一个pcd测试,若可以显示点云则安装成功
pcl_viewer xxx.pcd
5.vscode配置
Run and Debug 生成launch.json文件
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/${fileBasenameNoExtension}.out",
"miDebuggerPath": "/usr/bin/gdb",
"preLaunchTask":"build",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
Configure Tasks 配置Tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks":[
{
"label": "build",
"type": "shell",
"command": "g++",
"args":[
"-g",
"${workspaceFolder}/${fileBasename}",
"-I", "/usr/local/include/pcl-1.8",
"-I", "/usr/include/eigen3",
"-I", "/usr/include/vtk-5.10",
"-I", "/usr/include/qhull",
"-I", "/usr/include/flann",
"-I", "/usr/include/boost",
// lib 库文件地址
"-L", "/usr/local/lib",
"-l", "pcl_io",
"-l", "pcl_visualization",
"-l", "pcl_common",
"-l", "vtkFiltering",
"-l", "vtkCommon",
"-l", "vtkRendering",
"-l", "vtkGraphics",
"-L", "/usr/include/x86_64-linux-gnu",
"-l", "boost_system",
"-o",
"${workspaceFolder}/${fileBasenameNoExtension}.out"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "cmakebuild",
"type": "shell",
"command": "cd build && cmake ../ && make",
"args": []
}
]
}