当前位置:网站首页>Install PCL and VTK under the background of ROS installation, and solve VTK and PCL_ ROS conflict problem
Install PCL and VTK under the background of ROS installation, and solve VTK and PCL_ ROS conflict problem
2022-07-28 22:36:00 【TwilightZrui】
Antecedents feed :
I also need pcl_ros and PCL, Among them PCL_ROS Yes ROS after , Fill two bags :pcl-conversions pcl_ros, then PCL Install separately .
If you use the classic method Ubuntu18.04 install PCL( Detailed tutorial ) install PCL Words , It can lead to vtk Package conflict problem , namely PCL Need a certain version VTK To compile through , and pcl_ros Need another version VTK Can pass , Thus, the problem of conflict arises , Then the installation VTK、PCL and VTK Version selection 、PCL Already exist ROS Installation issues under , In the process, a series of bug.
This paper aims to solve such a problem : In the installation ROS Under the premise of , Install the appropriate version VTK and PCL.
1.ROS INTSLL
Install ROS-Melodic on ubuntu18.04
After installation, it needs to be pcl_ros Fill two bags :
sudo apt install ros-melodic-pcl-conversions ros-melodic-pcl-ros
2.PCL INSTALL
background : Already installed ROS In the context of PCL
Version adaptation :PCL 1.8.1 + VTK 7.1.1( important : The version must be adapted )
One 、 install PCL rely on
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 # ubuntu18 Corresponding 1.9
sudo apt-get install libeigen3-dev # You need to download the correct version and install it
sudo apt-get install libboost-all-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 libopenni-dev
sudo apt-get install libopenni2-dev
sudo apt-get install openjdk-8-jdk openjdk-8-jre
Two 、VTK install
1. First installation VTK Dependence X11
# First installation VTK Dependence :X11,OpenGL;
# X11
sudo apt-get install libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev
# OpenGL
sudo apt-get install build-essential libgl1-mesa-dev libglu1-mesa-dev
2. install VTK-7.1.1.
Download from the official website VTK7.1.1
decompression
sudo tar -xzvf VTK-7.1.1.tar.gz
Open terminal window .
cmake-gui . # open cmake Graphical interface of
Report errors 1:
open cmake-gui after , I found my cmake-gui yes 3.10 edition , And I installed cmake yes 3.20 edition , therefore cmake and cmake-gui Is not suitable , Will report a mistake
resolvent : stay bashrc Version specified in
code ~/.bashrc
export CMAKE_ROOT=/usr/local/share/cmake-3.21
Report errors 2:
stay configure VTK-7.1.1 when , Tips : Required qt4; Be similar to “Found unsuitable Qt version “” from NOTFOUND, this code requires Qt 4.x” Such a hint .
Solution :
install qt4: Execute in terminal
sudo apt-get install qt4-default
If you still report an error
stay cmake-gui Switch to qt edition 
Report errors 3:
Add the installation prefix of "Qt5X11Extras" to CMAKE_PREFIX_PATH or set "Qt5X11Extras_DIR" to a directory containing one of the above files.
solve :
sudo apt install libqt5x11extras5-dev
==========================================================================
cmake-gui Configure reference blog posts :PCL1.12+VTK7.1.1 && Ubuntu20.04.3+VSCode The latest version of the official website 2022.01
stay cmake-gui in :
To configure where is the source code by VTK-7.1.1 In the directory ;( stay VTK-7.1.1 Create a new build Folder );
To configure where to build the binaries by VTK-7.1.1 Under the build Folder ;
Click on “Configure”,( use “Unix Makefiles” Can ); When the configuration is complete , Show “Configuring done”.
Check “VTK-Group-Qt”, Click again “Configure”; When the configuration is complete , Show “Configuring done”;
Click on “Generate”; Show “Generating done”, stay build Generate project files under folder .
Switch to... In the terminal VTK-7.1.1 Install under directory build Folder , Input :
make -j8 # If 8 If the nuclear processor is still anxious to see the result , Sure :make -j16
sudo make install
vtk installation is complete .
==========================================================================
3. install PCL1.8.1
PCL Official website Historical version selection
# Download the specified version of pcl Source code
# Or in the latest version pcl Select the specified version of the source code , This paper adopts this method
git clone https://github.com/PointCloudLibrary/pcl.git
git checkout pcl-1.8.1
cd /path/to/your/pcl
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_GPU=OFF -DBUILD_apps=ON -DBUILD_examples=ON \ -DCMAKE_INSTALL_PREFIX=/usr /path/to/your/pcl
make
sudo make install
Finish loading PCL Then copy the library file to /usr/lib/x86_64-linux-gnu/
sudo cp /usr/lib/libpcl* /usr/lib/x86_64-linux-gnu/
PCL installation is complete
4. PCL test
stay pcl_test.cpp To add the following
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
int
main ()
{
pcl::PointCloud<pcl::PointXYZ> cloud;
// Fill in the cloud data
cloud.width = 5;
cloud.height = 1;
cloud.is_dense = false;
cloud.resize (cloud.width * cloud.height);
for (auto& point: cloud)
{
point.x = 1024 * rand () / (RAND_MAX + 1.0f);
point.y = 1024 * rand () / (RAND_MAX + 1.0f);
point.z = 1024 * rand () / (RAND_MAX + 1.0f);
}
pcl::io::savePCDFileASCII ("test_pcd.pcd", cloud);
std::cerr << "Saved " << cloud.size () << " data points to test_pcd.pcd." << std::endl;
for (const auto& point: cloud)
std::cerr << " " << point.x << " " << point.y << " " << point.z << std::endl;
return (0);
}
Copy the following to CMakeLists.txt
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(pcl_test)
find_package(PCL 1.3 REQUIRED COMPONENTS common io)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable(pcl_test src/pcl_test.cpp)
target_link_libraries(pcl_test ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES})
Running results :
[email protected]: ~/project/robot/test_pro/build$ ./pcl_test
Saved 5 data points to test_pcd.pcd.
0.352222 -0.151883 -0.106395
-0.397406 -0.473106 0.292602
-0.731898 0.667105 0.441304
-0.734766 0.854581 -0.0361733
-0.4607 -0.277468 -0.916762
3.uninstall PCL
cd /path/to/your/pcl
cd release
sudo make uninstall
perhaps
sudo rm -r /usr/include/pcl-1.12 /usr/share/pcl-1.12 /usr/bin/pcl* /usr/lib/libpcl*
sudo rm -r /usr/lib/x86_64-linux-gnu/libpcl*
thank
PCL1.12+VTK7.1.1 && Ubuntu20.04.3+VSCode( The latest version of the official website 2022.01)
Ubuntu18.04 install PCL( Detailed tutorial )
UBUNTu16.04 Compilation and installation PCL-1.8 and VTK-7.1
see pcl edition linux,Ubuntu16 Installation on PCL
Ubuntu16.04 Next pcl Kuhe vtk Installation and compilation of
ubuntu16.04 install pcl1.8.1( Clear and easy to understand , Close test effectively , Including the installation of ros Then install pcl1.8.1 course )
PLC Installation pit summary (Ubuntu 16.4+PCL1.8.1+VTK7.1+Qt5.9.9)
ubuntu 16 install ETH Elevation map ROS software package
Ubuntu18.04 install ROS when , Encounters an error “unmet dependencies. Unable to correct problems, you have held broken packages
边栏推荐
- Research cup element recognition multi label classification task based on ernie-3.0 cail2019 method
- Chrome encountered a problem when debugging the code. After modifying and saving the code in vscode, chrome did not update after refreshing
- 6K6w5LiA5qyh5pS75Ye75YiG5p6Q
- 75. Color classification (medium array double pointer sorting)
- Kali source solution software cannot be installed correctly
- Which is the file transfer command in the basic services of the Internet
- 【CVPR 2021】Cylinder3D:用于LiDAR点云分割的圆柱体非对称3D卷积网络
- Sword finger offer II 055. Binary search tree iterator (medium binary search tree iterator)
- 普源示波器实际的使用效果怎么样
- JMeter installs third-party plug-ins plugins Manager
猜你喜欢

Att & CK preliminary understanding

Static route and default route experiment

ATT&CK初步了解

Ruiji takeout project - development of business development function Day2

Ultra detailed visual studio 2019 running littlevgl (lvgl) simulator

SQL injection less34 (post wide byte injection + Boolean blind injection)

Less than a year after its establishment! MIT derivative quantum computing company completed financing of US $9million

flask之蓝图 补充openpyxl

Lvs+keepalived high availability deployment practical application

CMD common commands
随机推荐
Analysis notes on let (const) temporary dead zone in JS
删除容器镜像报错解决image is referenced in multiple repositories
76. Minimum coverage substring (hard sliding window hash table string)
微信小程序里button点击的时候会边框有黑线
[connect your mobile phone wirelessly] - debug your mobile device wirelessly via LAN
静态成员static详解
775. 倒排单词
微信小程序剪切图片的功能
2021 mathematical modeling group B exercise
Closure, prototype and original link
Excel-VBA 快速上手(十三、日期的常见用法)
elment-plus图标input上面带的图标为什么不显示
internet的基本服务中文件传输命令是哪个
79. Word search (medium string array matrix backtracking)
[Ruiji takeout project] Day5 - Chapter 6 mobile verification code login
75. Color classification (medium array double pointer sorting)
Static route and default route experiment
When can I sign up for the 2022 class I constructor examination?
Paddlenlp text classification based on ernir3.0: take wos dataset as an example (hierarchical classification)
Jmeter 安装第三方插件 Plugins Manager