Monday, July 4, 2016

Set up Visual Studio to use the All-in-one Point Cloud Library PCL

Point Cloud Library (PCL) from is a powerful library for working with point clouds. But the downloadable binaries are outdated and compiling the latest source code can be a bit of a pain. Fortunately, you can get more recent all-in-one PCL binaries from this blog site for use in your projects.

Installing PCL All-in-one

  1. Just follow the instructions on the site to download and install a version of PCL e.g. PCL 1.7.2 All-in-one Installer MSVC2015 X64, for your development environment.
  2. Also download a suitable Visual Studio property sheet e.g. PCL Property Sheet, and save the file on your machine as e.g. pclPropertySheet.props.
  3. After installing, add the bin folder locations of PCL and VTK to the Windows PATH environment variable, as shown below.

Setting up Visual Studio
  1. Run Visual Studio. Select File | New | Project.
    The New Project dialog appears.

  2. Select Templates | Visual C++ | General. Choose Empty Project. Type in a project Name e.g. HelloPCL. Browse to a Location. Click OK.

    The project is created.

  3. In the top right pane, click the Property Manager tab.

    The Property Manager tab is activated.

  4. Click the Add Existing Property Sheet icon, as shown above.
    The Add Existing Property Sheet dialog box appears.

  5. Browse and select the previously downloaded property sheet e.g. pclPropertySheet.props. Click Open.

    The property sheet is loaded.
  6. Now create a new C++ source file, e.g. main.cpp.

  7. In the C++ file, type in PCL include header file(s) and classes, as shown below.

  8. Optional: the PCL headers and classes may display wavy red under lines. If so make sure you are working in the correct configuration. In this example, the environment is for x64. Change the configuration to x64 from x86.

    Visual Studio now recognizes the PCL headers and classes

No comments:

Related Posts with Thumbnails