11 February 2013

Configuration of PCL (point cloud library) development environment

PCL (Point Cloud Library) is a standalone open-source framework including numerous state-of-the art algorithms for n-dimensional point clouds and 3D geometry processing. The library contains algorithms for filtering, feature estimation, surface reconstruction, registration, model fitting, and segmentation. Full introduction of PCL can be found here.
In this post, I will go through how to configure and build a PCL solution in VS2010, Win 7-x32.

  • Preparation
Four files must be downloaded in your computer:
cmake-2.8.10.2-win32-x86.exe (download)
PCL-1.6.0-AllInOne-msvc2010-win32.exe (download)
pcl-1.6.0-pdb-msvc2010-win32.zip (download)
PCL-1.6.0-Source.tar.bz2 (download)
Require files for PCL configuration
  • Installation
  1. Install the CMake in your computer, add it in system PATH during the setup program
  2. Install the "PCL-1.6.0-AllInOne-msvc2010-win32.exe". Follow the figure shown below and wait for the installation finished. If install the PCL in default directory (C:\), the configuration of the library would be done automatically, otherwise, you need to specify the library in CMake.
  3. In order to debug the PCL based project and step into PCL code even if we use PCL all-in-one installer, we need to: Unzip "pcl-1.6.0-pdb-msvc2010-win32.zip" inside the bin subfolder of your PCL installation folder, so that the pdb files lie near to the dlls; Once the debugger needs to step into PCL code, you will be asked for PCL sources folder. Unzip "PCL-1.6.0-Source.tar.bz2" somewhere on your disk, and give the debugger the path.


  •  Use CMake to build PCL project
1. As shown in the following figure, create a folder for your project (here is PCL_sample). Within the folder, create one empty folder (for CMake output), a CMake config file (CMakeLists.txt) and entry of your project (pcd_write.cpp). An example of content of "CMakeLists.txt" and "pcd_write.cpp" can be found here.

Before CMake the project
2. Open the CMake and choose the directory for the source code and where to build the binaries, then click Configure.
Choose directory in CMake
3. In the pop-up window, choose the Visual Studio 10 (if your are using 64bit please select the corresponding one) and then click finish.
Pop-up window
4. After the build is finished, click the Generate button and you will see the VS2010 solution files are created in the build folder.
Finish build in CMake
VS 2010 solution file is created by the CMake
  • Result
After compiling and running the program in VS2010, a point cloud data file (test_pcd.pcd in figure) is created. The basic data type is PointCloud which can be saved in *.pcd file by following format:

# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z
SIZE 4 4 4
TYPE F F F
COUNT 1 1 1
WIDTH 5
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 5
DATA ascii
1.28125 577.09375 197.9375
828.125 599.03125 491.375
358.6875 917.4375 842.5625
764.5 178.28125 879.53125
727.53125 525.84375 311.28125
Output of pcd_write.cpp





9 comments:

  1. Thank you for the helpful post. How do you exactly specify the debugger the path in which the PCL source code is stored?

    ReplyDelete
    Replies
    1. Hi, sorry for late reply, I didn't notice I got a comment. Consider you question, since I currently use the PCL by compiling it out of source I may not give you useful information. I think the Visual Studio (IDE I am using) would ask you to specify the directory of source when you try to debug your program into PCL codes.
      Hope it helps.

      Delete
    2. Can u please suggest me how to start coding with pcl with open cv

      Delete
    3. PCL-1.6.0-Source.tar.bz2 ->i doesn't find this file at all can u please suggest the exact link to down load file

      Delete
    4. Hi, I would suggest you build your project using CMake which can configure OpenCV and PCL for you. You just need to add few lines into the CMakeLists in addition to the content provided by each PCL tutorial. The exact place of the source for 1.6.0 is:http://sourceforge.net/projects/pointclouds/files/1.6.0/PCL-1.6.0-Source.tar.bz2/download
      hope this can help you.

      Delete
    5. Thanks .But i am getting so many errors when installing i had not got any sln.file in build folder..

      Delete
    6. In your build process it was showing errors in cmake how u solved it

      Delete
  2. After compiling and running the solution file. I am getting an error "Project out of date". Could you please help me?

    ReplyDelete
    Replies
    1. Hi, I am currently not using PCL and the post was almost two years ago. I may not be able to give you useful advice. Nevertheless, can you please explain your error more specifically and clearly?

      Delete