一、PCL依赖库安装
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15sudo 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
注意:很多朋友应该都是换了清华、中科大、阿里等源,如果update不能成功完成的话,可以更换成UBUNTU最原始的源。(我突然遇到了这个情况,换成原来的源就解决了)。
二、PCL1.9.0版本下载
github下载地址:pcl-1.9.0
下载tar.gz版本的
三、编译
将安装包放在home下
1.先解压安装包
复制代码
1tar -zxvf pcl-pcl-1.9.0.tar.gz
2.进入到安装包
复制代码
1
2
3cd pcl-pcl-1.9.0 mkdir build cd build
3.编译
复制代码
1
2
3cmake -DCMAKE_BUILD_TYPE=Release .. make -j4 sudo make install
实践较长,等待
四、测试安装环境
pcl_test.cpp
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46//pcl_test.cpp #include <iostream> #include <pcl/common/common_headers.h> #include <pcl/io/pcd_io.h> #include <pcl/visualization/pcl_visualizer.h> #include <pcl/visualization/cloud_viewer.h> #include <pcl/console/parse.h> int main(int argc, char **argv) { std::cout << "Test PCL !!!" << std::endl; pcl::PointCloud<pcl::PointXYZRGB>::Ptr point_cloud_ptr (new pcl::PointCloud<pcl::PointXYZRGB>); uint8_t r(255), g(15), b(15); for (float z(-1.0); z <= 1.0; z += 0.05) { for (float angle(0.0); angle <= 360.0; angle += 5.0) { pcl::PointXYZRGB point; point.x = 0.5 * cosf (pcl::deg2rad(angle)); point.y = sinf (pcl::deg2rad(angle)); point.z = z; uint32_t rgb = (static_cast<uint32_t>(r) << 16 | static_cast<uint32_t>(g) << 8 | static_cast<uint32_t>(b)); point.rgb = *reinterpret_cast<float*>(&rgb); point_cloud_ptr->points.push_back (point); } if (z < 0.0) { r -= 12; g += 12; } else { g -= 12; b += 12; } } 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()){ }; return 0; }
CMakeLists.txt
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14cmake_minimum_required(VERSION 2.8) project(pcl_test) find_package(PCL 1.9 REQUIRED) include_directories(${PCL_INCLUDE_DIRS}) link_directories(${PCL_LIBRARY_DIRS}) add_definitions(${PCL_DEFINITIONS}) add_executable(pcl_test pcl_test.cpp) target_link_libraries (pcl_test ${PCL_LIBRARIES}) install(TARGETS pcl_test RUNTIME DESTINATION bin)
效果:
参考文献:
Ubuntu 16.04下PCL1.9安装教程及demo测试_他们叫我一代大侠的博客-CSDN博客
最后
以上就是文艺铃铛最近收集整理的关于ubuntu 16.04安装PCL 1.9.0的全部内容,更多相关ubuntu内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复