ubuntu for ROS安装PCL

1.下载源码

git clone https://github.com/PointCloudLibrary/pcl.git

2.建立build目录编译

将下载完成的pcl文件拷贝到catkin_ws/src目录下,

在pcl文件中建立并进入build目录

$ mkdir build && cd build

编译安装

#默认安装/usr/local/include
cmake -DCMAKE_BUILD_TYPE=None -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON .. 

#安装/usr/include
cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr   -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON  -DCMAKE_INSTALL_PREFIX=/usr ..
 make -j2
$ sudo make install

3.CmakeList.txt中添加:

find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

然后catkin_make编译即可

你可能感兴趣的:(ros,计算机视觉,SLAM)