INSTALAÇÃO
Instale o oracle-java8-jdk:
sudo add-apt-repository -y ppa:webupd8team/java && sudo apt update && sudo apt -y install oracle-java8-installer
Instalar pré-requisitos universais:
sudo apt -y install g++ cmake cmake-gui doxygen mpi-default-dev openmpi-bin openmpi-common libusb-1.0-0-dev libqhull* libusb-dev libgtest-dev
sudo apt -y install git-core freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libphonon-dev libphonon-dev phonon-backend-gstreamer
sudo apt -y install phonon-backend-vlc graphviz mono-complete qt-sdk libflann-dev
Para PCL v1.8, o Ubuntu 16.04.2 insere o seguinte:
sudo apt -y install libflann1.8 libboost1.58-all-dev
cd ~/Downloads
wget http://launchpadlibrarian.net/209530212/libeigen3-dev_3.2.5-4_all.deb
sudo dpkg -i libeigen3-dev_3.2.5-4_all.deb
sudo apt-mark hold libeigen3-dev
wget http://www.vtk.org/files/release/7.1/VTK-7.1.0.tar.gz
tar -xf VTK-7.1.0.tar.gz
cd VTK-7.1.0 && mkdir build && cd build
cmake ..
make
sudo make install
cd ~/Downloads
wget https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.0.tar.gz
tar -xf pcl-1.8.0.tar.gz
cd pcl-pcl-1.8.0 && mkdir build && cd build
cmake ..
make
sudo make install
cd ~/Downloads
rm libeigen3-dev_3.2.5-4_all.deb VTK-7.1.0.tar.gz pcl-1.8.0.tar.gz
sudo rm -r VTK-7.1.0 pcl-pcl-1.8.0
Para PCL v1.8.1, o Ubuntu 17.10 insere o seguinte:
sudo apt -y install libflann1.9 libboost1.63-all-dev libeigen3-dev
cd ~/Downloads
wget http://www.vtk.org/files/release/8.0/VTK-8.0.1.tar.gz
tar -xf VTK-8.0.1.tar.gz
cd VTK-8.0.1 && mkdir build && cd build
cmake ..
make
sudo make install
cd ~/Downloads
wget https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.1.tar.gz
tar -xf pcl-1.8.1.tar.gz
cd pcl-pcl-1.8.1 && mkdir build && cd build
cmake ..
make
sudo make install
cd ~/Downloads
rm VTK-8.0.1.tar.gz pcl-1.8.1.tar.gz
sudo rm -r VTK-8.0.1 pcl-pcl-1.8.1
VALIDAÇÃO
cd ~
mkdir pcl-test && cd pcl-test
Crie um arquivo CMakeLists.txt:
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(pcl-test)
find_package(PCL 1.2 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable(pcl-test main.cpp)
target_link_libraries(pcl-test ${PCL_LIBRARIES})
SET(COMPILE_FLAGS "-std=c++11")
add_definitions(${COMPILE_FLAGS})
Crie um arquivo main.cpp:
#include <iostream>
int main() {
std::cout << "hello, world!" << std::endl;
return (0);
}
Compilação:
mkdir build && cd build
cmake ..
make
Teste:
./pcl-test
Saída - > hello, world!
Este método de instalação tem como objetivo ser o mais compatível possível e possibilitar um meio fácil de se levantar e correr com o Point Cloud Library. Este método não inclui a configuração do Kinect que requer a instalação prévia de outros pacotes antes que o pcl possa ser configurado.