链接
PCL官网:http://www.pointclouds.org/
PCL GitHub:https://github.com/PointCloudLibrary/pcl
python-pcl GitHub:https://github.com/strawlab/python-pcl
PCL编译安装
1、下载pcl-pcl-1.9.1.zip,解压;
2、mkdir build && cd build
3、cmake .. -DCMAKE_BUILD_TYPE=Release
4、make -j8 && make install -j8
python-pcl安装
1、安装依赖包:numpy, Cython==0.25.2
2、sh build.sh
问题
1、服务器端编译PCL,不需要OpenGL/VTK等显示工具。
VTK找不到只会报警告,不碍事。
CMake Warning at CMakeLists.txt:366 (find_package):
By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "VTK", but
CMake did not find one.
Could not find a package configuration file provided by "VTK" with any of
the following names:
VTKConfig.cmake
vtk-config.cmake
Add the installation prefix of "VTK" to CMAKE_PREFIX_PATH or set "VTK_DIR"
to a directory containing one of the above files. If "VTK" provides a
separate development package or SDK, be sure it has been installed.
若需要关闭OpenGL依赖,修改PCL源码包根目录CMakeLists.txt 第414行如下。
# 错误代码
Could NOT find OpenGL (missing: OPENGL_INCLUDE_DIR)
# 取消OpenGL依赖
option(WITH_OPENGL "Support for OpenGL" FALSE)
2、指定安装路径
修改PCL源码包根目录CMakeLists.txt,找到这两行,打开。
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
然后,在使用cmake生成工程的时候,加上:
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/path/to/install
3、安装python-pcl时,提示找不到pcl_2d-1.8.pc
错误代码
Package pcl_2d-1.8 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pcl_2d-1.8.pc'
to the PKG_CONFIG_PATH environment variable
修改pcl_install_path/lib/pkgconfig/pcl_features-1.8.pc,第10行,去掉最后的pcl_2d-1.8。
Requires: pcl_common-1.8 pcl_search-1.8 pcl_kdtree-1.8 pcl_octree-1.8 pcl_filters-1.8