Skip to content

Kinect One

Yoshua Nava edited this page Dec 18, 2017 · 1 revision

Dependencies

sudo apt-get install beignet \
                     beignet-dev \
                     build-essential \
                     cmake \
                     libopencv-dev \
                     libturbojpeg \
                     libusb-1.0-0-dev \
                     libjpeg-turbo8-dev \
                     opencl-headers \
                     pkg-config \
                     python-opencv

Create the KinectOne ROS Workspace

mkdir -p kinectOne_depends_ws/src
cd kinectOne_depends_ws/src
catkin_init_workspace
cd ..
catkin_make
echo "export KINECTONE_WS='$(pwd)'" >> ~/.bashrc
echo "source $(pwd)/devel/setup.bash" >> ~/.bashrc
bash

Clone, set udev rules and build libfreenect2

bash
cd $KINECTONE_WS/src
git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2

Before plugging in the Kinect, set up the udev rules for device access:

sudo cp platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/

Then build:

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$KINECTONE_WS/src/freenect2 -DENABLE_CXX11=ON
make -j4
sudo make install

Clone and build iai_kinect2

Run these commands to clone the iai_kinect2 package:

bash
cd $KINECTONE_WS/src
git clone https://github.com/code-iai/iai_kinect2.git
sed -i '28 i add_definitions( -fexceptions )' iai_kinect2/kinect2_registration/CMakeLists.txt

Then, open the file iai_kinect/kinect2_bridge/CMakeLists.txt with a text editor, and replace line 22, find_package(freenect2 REQUIRED HINTS "$ENV{HOME}freenect2"), withfind_package(freenect2 REQUIRED HINTS "$ENV{KINECTONE_WS}/src/freenect2")

Finally, run the following commands:

cd $KINECTONE_WS
catkin_make -DCMAKE_BUILD_TYPE=Release