How to use PCL 1.8

In this post, we are going to learn how to use PCL 1.8. Let’s start with installation.

Steps to install PCL 1.8 locally

  1. Clone the source from Git using following command git clone https://github.com/PointCloudLibrary/pcl.git
  2. Go inside the downloaded source i.e., cd pcl
  3. Make directory to build cmake files i.e., mkdir build
  4. Go inside the directory i.e., cd build
  5. Create additional directory to store compiled files i.e., mkdir ../release
  6. Run cmake by providing recently created release directory as CMAKE_INSTALL_PREFIX i.e.,
    cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=`pwd`/../release -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON -DCMAKE_INSTALL_PREFIX=`pwd`/../release .. 
    
  7. Run make i.e., make
  8. Run make install i.e., make install

Please remember the full path to release directory. In my computer, it is /home/ravi/Tools/pcl/release.

Configure CMakeLists.txt to Use PCL 1.8

Make sure to set following variables in your CMakeLists.txt file

cmake_minimum_required(VERSION 2.6 FATAL_ERROR)

set(PCL_FOLDER /home/ravi/Tools/pcl/release)
find_package(PCL 1.8 REQUIRED PATHS ${PCL_FOLDER} NO_DEFAULT_PATH)

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

MESSAGE(STATUS "PCL_VERSION: " ${PCL_VERSION})

add_executable (simple_visualizer src/simple_visualizer.cpp)
target_link_libraries (simple_visualizer ${PCL_LIBRARIES})

Follow point-cloud-visualization for a PCL tutorial.

Written on February 27, 2018