Windows下 C++ PCL lib 安装

[TOC]

PCL 官方资料

官网:https://pointclouds.org/

Windows 10

ref: https://blog.csdn.net/weixin_41991128/article/details/83864713

windows系统下PCL的安装与配置

PCL学习笔记(一)– Windows下配置安装PCL开发环境

下载

https://github.com/PointCloudLibrary/pcl/releases

安装

1、exe文件安装,安装路径D:/tools/plc/

2、pdb文件拷贝

​ 解压pcl-1.12.1-pdb-msvc2019-win64.zip里面的所有pdb文件,放到D:/tools/pcl/bin

Ubuntu PCL build & install

https://github.com/PointCloudLibrary/pcl/releases/

依赖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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-dev libudev-dev
sudo apt-get install mpi-default-dev openmpi-bin openmpi-common
sudo apt-get install libpcap-dev
sudo apt-get install libflann1.8 libflann-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libopenni2-dev
sudo apt-get install libqhull7 libqhull-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

编译

1
2
3
cmake ..
make
sudo make install

测试

1
/usr/local/bin/pcl_viewer ~/program/pcl-1.8.1/test/car6.pcd

使用PCL

网络上的demo: https://www.bbsmax.com/A/x9J2Pl8Kd6/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(cloud_viewer)
# set bin folder
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})

find_package(PCL 1.8.1 REQUIRED)
#message( [***] ${PCL_INCLUDE_DIRS})
#message( [***] ${PCL_LIBRARY_DIRS})
#message( [***] ${PCL_DEFINITIONS})
#message( [***] ${PCL_LIBRARIES})

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (cloud_viewer cloud_viewer.cpp)
target_link_libraries (cloud_viewer ${PCL_LIBRARIES})