Using pcl 1.7 standalone with ros fuerte

This page explains how to use pcl 1.7 standalone installation with ros fuerte.

This could be interesting if people do not want to compile the pcl from source. If not, the pcl17 ( package should do the trick.

I have tested this in Ubuntu 12.04. There is a test ros package that compiles against pcl 1.7 standalone at

The Problem

The problem after installing pcl 1.7 standalone, is that you have the pcl 1.7 libraries at /usr/lib and the pcl1.5 libraries in /opt/ros/fuerte/lib

A package that might use both link directories -L/opt/ros/fuerte/lib and -L/usr/lib, which confuses cmake. Actually, normally, cmake will link against pcl-1.5, which is not what we want.

A similar problem occurs with the pcl1.5/1.7 headers.

Installing pcl 1.7 standalone

sudo apt-get install libpcl-1.7-all-dev

Finding pcl-1.7 with cmake

Add to the CMakeLists.txt

#Find PCL 1.7
find_package(PCL 1.7 REQUIRED)
include_directories(BEFORE ${PCL_INCLUDE_DIRS})
    MESSAGE(FATAL_ERROR "PCL not found.\n")

Linking against pcl-1.7

To link against pcl 1.7, we must make sure:

* a) The -I/usr/include/pcl-1.7 flag comes before the -I/opt/ros/fuerte/include/pcl-1.5

This is solved by the instruction:

include_directories(BEFORE ${PCL_INCLUDE_DIRS})

* b) That the -L/usr/lib comes before -L/opt/ros/fuerte/lib

This is solved by editing the properties of your compilation targets:

rosbuild_add_executable(MY_TARGET src/my_target.cpp)

Wiki: pcl17_standalone (last edited 2013-11-07 14:26:41 by miguelriem)