Ubuntu16 04安裝PCL並測試

2021-10-01 08:59:31 字數 2871 閱讀 1344

第一步、 安裝依賴

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

git clone
cd pcl

mkdir release

cd release

cmake -dcmake_build_type=none -dcmake_install_prefix=/usr \

-dcmake_install_prefix=/usr ..

make

sudo

make

install

第四步(可選 and 建議):如果需要pclvisualizer 安裝openni、openni2

sudo

apt-get

install libopenni-dev

sudo

apt-get

install libopenni2-dev

接下來是測試部分:

在home下建立資料夾 pcl_test

cd pcl_test

vim pcl_test.cpp

pcl_test.cpp如下:

#include

#include

#include

#include

#include

#include

intmain

(int argc,

char

**ar**)

if(z <

0.0)

else

} point_cloud_ptr-

>width =

(int

) point_cloud_ptr-

>points.size ();

point_cloud_ptr-

>height =1;

pcl::visualization::cloudviewer viewer (

"test");

viewer.

showcloud

(point_cloud_ptr)

;while

(!viewer.

wasstopped()

);return0;

}

cmakelists.txt檔案如下:

cmake_minimum_required(version 2.6)

project(pcl_test)

find_package(pcl 1.2 required)

include_directories($)

link_directories($)

add_definitions($)

add_executable(pcl_test pcl_test.cpp)

target_link_libraries (pcl_test $)

install(targets pcl_test runtime destination bin)

然後在pcl_test資料夾下新建乙個build資料夾:

mkdir build &&

cd build

cmake ..

##cmake ..代表對上級目錄內的cmakelists進行生成編譯檔案

make

##根據生成的編譯檔案進行編譯

./pcl_test ##執行生成的可執行檔案

下面是我運的結果,如果是一團變紅色,旋轉一下滑鼠就好啦。

ubuntu16 04安裝PCL總結

ubuntu裝軟體真的麻煩,乙個pcl庫費了我整整兩天時間 在此總結下,讓大家少踩坑。sudo add apt repository ppa v launchpad jochen sprickerhof de pcl sudo apt get update sudo apt get install ...

Ubuntu16 04編譯安裝PCL 測試執行

環境 ubuntu16.04 pcl版本 1.8.1 一.安裝依賴庫 sudo apt get update sudo apt get install git build essential linux libc dev sudo apt get install cmake cmake gui su...

Ubuntu16 04下安裝並測試pcl

sudo chmod u x qt unified linux x64 3.1.0 online.run sudo qt unified linux x64 3.1.0 online.run 根據提示進行,並設定安裝路徑就好 我用的是預設的路徑 2 安裝x11 sudo apt get instal...