Compiling The Open Source Kinect Fusion (PCL Point Cloud Library)

Compiling The Open Source Kinect Fusion (PCL Point Cloud Library)

This tutorial is for windows with Visual Studio 2010. It will help you get started developing with CUDA and Kinfu

Prerequisite Hardware

A Kinect.

A Kinect Power Adapter. You can get this for as little as $5 on amazon here: Amazon Kinect Power Adapter

An NVidia graphics processor that supports CUDA.

Visual Studio 2010 with c++ installed

CMake GUI installed (the graphical version. It’s free. just google it, download and install)

DownloadSVN (for downloading source code from source forge and other open source project hosts. same procedure as cmake, just google it and install)

Note

The visualization doesn’t have color yet. If you’re looking for color and don’t want to wait or you don’t have a gpu, then you might want to play around with RGBDemo. I’ll write a tutorial soon on how to get that up and running also.

Step 1 - Install CUDA

Go to the CUDA toolkit website.

I installed both the toolkit and the GPU Computing SDK. I’m not sure if the SDK was necessary, but when using CMake to compile PCL, you can add the SDK directory.

I downloaded the 64-bit version with version number 4.0.17. Here are the links I used:

http://www.nvidia.com/object/thankyou.html?url=/compute/cuda/4_0/toolkit/cudatoolkit_4.0.17_win_64.msi

http://developer.download.nvidia.com/compute/cuda/4_0/sdk/gpucomputingsdk_4.0.19_win_64.exe

Step 2 - Download PCL trunk source and Install PCL Dependencies

There is a tutorial for how to do this here.

If you don’t know how to use SVN tools to download source code, google DownloadSVN and use that. It’s quite simple. Then continue the tutorial mentioned above.

Note: Use the individual dependency installers! Don’t use the all-in-one installer, because you’ll have lots of problems.

Important: Be careful not to install any components of a different bit type from what you plan to use! If you have a 64-bit computer and want to use 64-bit, make sure everything is 64-bit from cuda to the dependencies to the drivers you install!

Important: Uninstall all bit versions of software that are not the bit type (32 or 64) that you chose to use! Otherwise you will run into pesky bugs when you accidentally link to the wrong library that uses the wrong bit type!

Also be careful of multiple installations of cuda. When I installed some cuda tools, it installed version 3.2, but I planned to use version 4.0. Then when I ran cmake, it automatically uses 3.2 instead of 4.0! So, I got compile errors later on. Be careful of this sort of thing!

Step 4 -Configure PCL Source Code with CMake

Follow the tutorial mentioned before. But there are additional things you’ll need to do for including and compiling Kinfu (kinect fusion).

Make sure BUILD_cuda is checked in cmake

Do *not* enable openCV. It caused errors for me that I had to fix manually. So, search for openCV related items in cmake and disable them if you find any.

For whatever reason, I could not get cmake not to include OpenCV. So, instead what I did was I manually modified the file C:\pcl-trunk\cuda\apps\CMakeList.txt and commented out the line:

FIND_PACKAGE (OpenCV)

by making it

#FIND_PACKAGE (OpenCV)

Then delete the OpenCV variable in CMake and hit configure again.

That finally got rid of my problems with OpenCV and CMake.

There are a few other things you must configure to see the kinfu projects

Check the following cmake items under the Build section. I’m not sure if they are all necessary, but this is how I got mine to work.

Build_apps

BUILD_visualization

BUILD_tools

Step 6 - Generate the Project Files in CMake

Now that everything is configured, hit the generate button.

Your solution file is now in the folder: C:\pcl-trunk\build ! or wherever you told it to create your build folder.

Step 5 - Compile the Project (Finally!)

Be warned, if you try to build everything in the project it will generate GBs of stuff and will take quite a while! :)

So, what we really want to do is just build the project Kinfu_app

Right click on the kinfu_app project and click “Build”

Step 6 - Run Open Kinect Fusion!

Navigate to the directory C:\pcl-trunk\build\bin\Debug

Run the executable! I think it’s called kinfu_app.exe

Step 7 - Enjoy!!!

Errors

Cuda Driver Version is Insufficient for CUDA Runtime Version

If you get this error, it is because the driver you have on your computer for your graphics card is too old for the CUDA Toolkit version you installed. You have two choices to fix the problem. The ideal solution is to download the latest nvidia drivers for your card from here: http://www.nvidia.com/Download/index.aspx?lang=en-us

If you have an older version of windows or something, the latest drivers may no longer be sufficient because nvidia may have stopped updating them. So, if that’s the case (such as if you have windows xp), you’ll need to uninstall the CUDA Toolkit you installed and pick an earlier version of the toolkit from the nvidia toolkit archive: http://developer.nvidia.com/cuda-toolkit-archive

Always double check first that everything is plugged in! Your kinect must be plugged into your computer and the power supply for the kinect must also be plugged in. Otherwise, you’ll get errors when you try to run a program that requires it. Don’t waste your time hunting for bugs because of this! :)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值