Series
- Part-1: Install and Configure Qt5 on Ubuntu 16.04
- Part-2: Install and Configure VTK 8.1.0 from source with Qt5 on Ubuntu 16.04
- Part-3: Install and Configure PCL 1.8.1 with vtk qt support on Ubuntu 16.04 from source
- Part-4: Install and Configure PCL 1.8.1 with vtk qt support on windows 10 from source
Guide
- qt: 5.7.0
- qmake: 3.0
- qtcreator: 3.5.1
- vtk: 8.1.0 (source)
- pcl :1.8.1 (source)
Setup Prerequisites
1 | sudo apt-get update |
metslib
for cmake error:
no metslib found.
fix by
1 | wget https://www.coin-or.org/download/source/metslib/metslib-0.5.3.tgz |
glxinfo
install
1 | sudo apt-get install mesa-utils |
possible error
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 34 ()
Serial number of failed request: 34
Current serial number in output stream: 33
fix,make sure NVIDIA drivers are installed successfully and no conflict.
check display OpenGL info
1 | $ glxinfo | grep OpenGL |
It means we use OpenGL version 4.5.0 for NVIDIA display.
Or by nvidia-settings
, NVIDIA X Server Settings–> X Screen 0 –> OpenGL/GLX Information.
compile
1 | wget https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.1.tar.gz |
with options
QT_USE_FILE /home/kezunlin/program/pcl-1.8.1/build/use-qt5.cmake
VTK_DIR /usr/local/lib/cmake/vtk-8.1
CMAKE_BUILD_TYPE Release
CMAKE_CONFIGURATION_TYPES Release
CMAKE_INSTALL_PREFIX /usr/local
PCL_SHARED_LIBS ON
PCL_QT_VERSION 5
PCL_ENABLE_SSE ON
Build_visualization ON
Build_apps ON
Build_examples OFF # error may occur
Using CPU native flags for SSE optimization:
-march=native
make and install
1 | # it may take several minutes, wait ... |
cmake install to
/usr/local/bin
,/usr/local/lib/
,/usr/local/include/pcl-1.8
PCL_DIR
will be/usr/local/share/pcl-1.8
error for example
/home/kezunlin/program/pcl-1.8.1/examples/segmentation/example_cpc_segmentation.cpp:493:17: error: ‘class vtkUnsignedCharArray’ has no member named ‘InsertNextTupleValue’
colors->InsertNextTupleValue (color);
so cmake with options
Build_examples OFF
Test pcl_viewer
test pcl_viewer
1 | /usr/local/bin/pcl_viewer ~/program/pcl-1.8.1/test/car6.pcd |
Success.
Tips: screen snapshot by
gnome-screenshot -a
.
Cloud Viewer
cloud_viewer.cpp
1 |
|
CMakeLists.txt
1 | cmake_minimum_required(VERSION 2.8 FATAL_ERROR) |
compile
1 | mkdir build |
run demo
bin folder
1 | $ tree bin/ |
run demo
1 | ./cloud_viewer |
Code Example
see Part-4: Install and Configure PCL 1.8.1 with vtk qt support on windows 10 from source
Reference
for windows
History
- 20180105: created.
- 20180227: rewrite pcl compile part.