본문 바로가기

ROS2

[ROS2] PCL 1.13.1(Point Cloud Library) install & compile

1. source.tar.gz download

link

2. 압축 해제

tar xvf source.tar.gz

3. make build & install

cd pcl-pcl-1.13.1 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make -j4 install

4. CMakeLists.txt 수정

cmake_minimum_required(VERSION 3.5)
project(your_project)

find_package(PCL 1.13 REQUIRED COMPONENTS common io filters segmentation search)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_executable(your_executable your_source_files.cpp)

target_link_libraries(
  your_executable
  ${PCL_COMMON_LIBRARIES}
  ${PCL_IO_LIBRARIES}
  ${PCL_FILTERS_LIBRARIES}
  ${PCL_SEGMENTATION_LIBRARIES}
  ${PCL_SEARCH_LIBRARIES}
)