Wednesday, November 27, 2013

Step 2: Save a Point Cloud from a Kinect

Because the Point Cloud Library website provides an easy implementation for saving point clouds to a file, which can be found here, creating a class for to accomplish this was very trivial. In my project, I call this class OpenNISaveFrame, which saves the point cloud captured by the Kinect into a binary compressed format and as a .pcd (Point Cloud Data) file.

The part of this step that was not trivial was trying to combine these two classes into one workable program that can be implemented rather quickly. My first attempts at this have fail as the libreenect and OpenNI "fight" over control of the Kinect with their function calls. More technically, when the program wants to move the Kinect's motor, the code establishes a signal to the Kinect in the code via libfreenect functions and moves the Kinect accordingly. If the program wants to save point clouds from the Kinect, the code establishes a different connection via PCL and OpenNI functions and the Kinect responds to that signal accordingly. The problem occurs when both connections are being established in the same program. One of two different complications occurred while testing this problem:

  - The libfreenect connection is established, but the OpenNI/PCL connection throws an Exception as the OpenNI/PCL cannot establish a connection with the Kinect since the libfreenect connection is still sending signals to the Kinect, causing the program to end prematurely.

- The libfreenect connection is established and manually shutdown by the code, which causes a segmentation fault to occur in the program.

Since I believe there is a way to get this two libraries to work concurrently in the same program. I will continue to experiment with the classes and the program and will update this blog accordingly.

*** Update: through more testing, I have come to find out that freenect_sync.h and freenect_sync.c provide a disconnection in the thread between the signal and the Kinect. I need to create a class and immediately implement it. (12/1/13) ***

Friday, November 22, 2013

Step 1: Moving the Kinect Motor

The first step for my project is to get the Kinect Motor to tilt so that it is possible to take point clouds of an environment from different angles. Unfortunately, this is not possible using the Point Cloud Library and through a series of tests, it is also not very effective using the implementation provided by OpenNI in the Linux environment. Based on this observations, I have turn to a older C++ library called libfreenect developed by the OpenKinect community. With this library, I was able to create a C++ class called KinectMotor.h. For the purpose of my project, this class will deal with any adjustments needed to the hardware components of the Kinect such as moving and tilting the Kinect angle and changing the LED light on the Kinect.





Based on some experimentations, I have come to find out that the Kinect can only tilt between -31 and 31 degrees, with 0 as the reset angle. I should conduct some timing on the code to see how long it takes for the commands to take over the Kinect and move the device accordingly.

Next, I need to combine the C++ libraries OpenNI and libfreenect in the same program, as I will need the libfreenect library to move the Kinect to the appropriate angle and the OpenNI library to save the point clouds to a file to be processed later.

Saturday, November 16, 2013

Research Overview

My name is Brandon Johnson. I am a first year graduate student in the Department of Scientific Computing at Florida State University. My purpose for creating this blog is to keep an up-to-date development log on my research involving the Microsoft Kinect and the Point Cloud Library. I plan on presenting this research at the campus-wide expo called DIGITECH and the department's Computational Expo. I also plan on publishing a paper on my work done from now to April or May 2014.