草庐IT

ubuntu18.04安装pcl1.9.1

枭玉龙 2023-11-12 原文

ubuntu18.04安装pcl1.9.1所需的cmake3.14.3和vtk8.2.0

先安装Qt5,X11,OpenGL

根据VTK的要求要先安装Qt5,X11,OpenGL

根据 官方文档 ,先更新qt5的依赖,python、Perl、Ruby
再进入 官网 下载Qt5:https://download.qt.io/archive/online_installers/3.2/
或者进入 清华源 下载镜像
我选择了5在线安装的最新版本

sudo chmod a+x 然后把安装包拖到这个a+x后面



直接把安装包拖到终端里

根据提示进行安装,安装完毕
2)安装x11

sudo apt-get install libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev

3)安装OpenGL

sudo apt-get install build-essential libgl1-mesa-dev libglu1-mesa-dev

4)安装libglut-dev

sudo apt-get install freeglut3-dev

5)安装metslib点云驱动包

下载地址:https://www.coin-or.org/download/source/metslib/metslib-0.5.3.tgz

tar xzvf metslib-0.5.3.tgz

cd metslib-0.5.3

./configure

make -j4

sudo make install

安装CMAKE

下载地址:https://cmake.org/download/
解压:

tar -zxvf cmake-3.16.0-rc2.tar.gz

1:安装pcl所需依赖

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-1.0-0-dev libusb-dev libudev-dev
sudo apt-get install mpi-default-dev openmpi-bin openmpi-common
sudo apt-get install libflann1.9 libflann-dev
sudo apt-get install libeigen3-dev 
sudo apt-get install libboost-all-dev
 sudo apt-get install openjdk-8-jdk openjdk-8-jre
sudo apt-get install libvtk7.1-qt
sudo apt-get install libvtk7.1
sudo apt-get install libvtk7-qt-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 openjdk-8-jdk openjdk-8-jre

linux安装eigen3
首先在终端执行命令:

sudo apt-get install libeigen3-dev

由于Eigen文件夹被默认安装到了路径:/usr/include/eigen3/Eigen,用#include<Eigen/Dense>无法通过编译,故需将Eigen文件夹放到/usr/include 下,需执行命令:

sudo cp -r /usr/include/eigen3/Eigen /usr/include

2:opengl报错

解决方案

在CMakeLists.txtS上添加以下代码

set(OpenGL_GL_PREFERENCE LEGACY)

3:Could NOT find PCAP (missing: PCAP_LIBRARIES PCAP_INCLUDE_DIRS)Could NOT find PCAP (missing: PCAP_LIBRARIES PCAP_INCLUDE_DIRS)在安装PCL时会有这样的错误:Could NOT find PCAP (missing: PCAP_LIBRARIES PCAP_INCLUDE_DIRS)

3.1下载pcap包,地址:http://www.tcpdump.org/#latest-release

tar -zxvf libpcap-1.9.0.tar.gz

cd libpcap-1.9.0

./configure

make -j8

sudo make install

3.2:如果在./configure时出现:

configure: error: Neither flex nor lex was found.

解决办法:

sudo apt-get install flex bison

4:下载libvtk7报错

解决办法

sudo apt-get install libvtk7-dev=7.1.1+dfsg1-2

还是报错

sudo apt-get install libvtk7-java=7.1.1+dfsg1-2

还是有的话

sudo apt-get install libvtk7-jni=7.1.1+dfsg1-2

这个报错需要多试几遍才能解决

5:下载VTK-8.2.0版本

地址:https://vtk.org/download/

安装依赖项

sudo apt-get install cmake-curses-gui
sudo apt-get install freeglut3-dev

下载下面适合的包

mkdir build
cd build
machine-gun

6:配置VTK

sudo make
sudo make install

7:PLC1.9.1下载地址:https://github.com/PointCloudLibrary/pcl/releases/tag/pcl-1.9.1

展开Module和VTK,然后分别在里面配置勾选这两个:Module_vtkGUISupportQt、VTK_Group_Qt ,点击configure和generate,出错

cd pcl-pcl-1.9.1
mkdir  build
cd  build

如添加选择

8:进行编译

make -j8

报错/usr/local/include/eigen3/Eigen/src/Core/products/Parallelizer.h:162:40:错误:“eigen_assert_exception”不是“Eigen”的成员if (errorCount) EIGEN_THROW_X(Eigen::eigen_assert_exception());

解决方案

在CMakeLists.txt上添加以下代码

include_directories("/usr/include/eigen3")

8.1:点云可视化工具

sudo make -j4 install

下载plc-tools

sudo apt-get install pcl-tools

9:验证

9.1: 在home目录下右击创建一个test_pcl文件夹,再创建一个源文件test_pcl.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>
using namespace std;
 
int main(int argc, char **argv) {//柱型点云测试
  cout << "Test PCL !" << 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 = cos (pcl::deg2rad(angle));
      point.y = sin (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 ("pcl—test测试");
 
  viewer.showCloud(point_cloud_ptr); 
  while (!viewer.wasStopped()){ };
  return 0;
}
  1. 2:在test_pcl文件夹下再创建一个配置文件CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(test_pcl)
 
find_package(PCL 1.2 REQUIRED)
 
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
 
add_executable(test_pcl test_pcl.cpp)
 
target_link_libraries (test_pcl ${PCL_LIBRARIES})
 
install(TARGETS test_pcl RUNTIME DESTINATION bin)

9.3:编译

在test_pcl文件夹下再建一个build文件夹,在build文件夹下打开终端。

输入 cmake …,然后输入 make进行编译。

mkdir build
cd build
cmake ..
make
./test_pcl

有关ubuntu18.04安装pcl1.9.1的更多相关文章

  1. ruby - i18n Assets 管理/翻译 UI - 2

    我正在使用i18n从头开始​​构建一个多语言网络应用程序,虽然我自己可以处理一大堆yml文件,但我说的语言(非常)有限,最终我想寻求外部帮助帮助。我想知道这里是否有人在使用UI插件/gem(与django上的django-rosetta不同)来处理多个翻译器,其中一些翻译器不愿意或无法处理存储库中的100多个文件,处理语言数据。谢谢&问候,安德拉斯(如果您已经在ruby​​onrails-talk上遇到了这个问题,我们深表歉意) 最佳答案 有一个rails3branchofthetolkgem在github上。您可以通过在Gemfi

  2. ruby - 在 64 位 Snow Leopard 上使用 rvm、postgres 9.0、ruby 1.9.2-p136 安装 pg gem 时出现问题 - 2

    我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po

  3. ruby-on-rails - Rails 3 I18 : translation missing: da. datetime.distance_in_words.about_x_hours - 2

    我看到这个错误:translationmissing:da.datetime.distance_in_words.about_x_hours我的语言环境文件:http://pastie.org/2944890我的看法:我已将其添加到我的application.rb中:config.i18n.load_path+=Dir[Rails.root.join('my','locales','*.{rb,yml}').to_s]config.i18n.default_locale=:da如果我删除I18配置,帮助程序会处理英语。更新:我在config/enviorments/devolpment

  4. ruby - 完全离线安装RVM - 2

    我打算为ruby​​脚本创建一个安装程序,但我希望能够确保机器安装了RVM。有没有一种方法可以完全离线安装RVM并且不引人注目(通过不引人注目,就像创建一个可以做所有事情的脚本而不是要求用户向他们的bash_profile或bashrc添加一些东西)我不是要脚本本身,只是一个关于如何走这条路的快速指针(如果可能的话)。我们还研究了这个很有帮助的问题:RVM-isthereawayforsimpleofflineinstall?但有点误导,因为答案只向我们展示了如何离线在RVM中安装ruby。我们需要能够离线安装RVM本身,并查看脚本https://raw.github.com/wayn

  5. ruby-on-rails - rails 目前在重启后没有安装 - 2

    我有一个奇怪的问题:我在rvm上安装了ruby​​onrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(

  6. ruby - 如何为 emacs 安装 ruby​​-mode - 2

    我刚刚为fedora安装了emacs。我想用emacs编写ruby。为ruby​​提供代码提示、代码完成类型功能所需的工具、扩展是什么? 最佳答案 ruby-mode已经包含在Emacs23之后的版本中。不过,它也可以通过ELPA获得。您可能感兴趣的其他一些事情是集成RVM、feature-mode(Cucumber)、rspec-mode、ruby-electric、inf-ruby、rinari(用于Rails)等。这是我当前用于Ruby开发的Emacs配置:https://github.com/citizen428/emacs

  7. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  8. ruby - 通过 RVM (OSX Mountain Lion) 安装 Ruby 2.0.0-p247 时遇到问题 - 2

    我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search

  9. ruby - 如何在 Lion 上安装 Xcode 4.6,需要用 RVM 升级 ruby - 2

    我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121

  10. ruby - Fast-stemmer 安装问题 - 2

    由于fast-stemmer的问题,我很难安装我想要的任何ruby​​gem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=

随机推荐