Kinect V1 Setup - ashBabu/Utilities GitHub Wiki
- Check
cmake
version by runningcmake --version
- If
cmake
version not greater than 3.10, then updatecmake
to a version higher than 3.10. as per below heading. - Install libfreenect from here for Kinect v1 or libfreenect2 for Kinect v2.
- Below are some additional instructions copied from another repo1 repo2
The Kinect360 sensor is equipped with a RGB camera(640x480 pixels at 30 FPS),an infra red projector and an infra red sensor.
(Installation):
I) :
sudo apt-get install cmake libglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev python
if you get “Unable to locate package libglut3-dev” error, use this command instead:
sudo apt-get install cmake freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev python
sudo apt-get install doxygen mono-complete graphviz
II) : Freenect Library:
libfreenect is a cross-platform library that provides the necessary interfaces to activate, initialize, and communicate data with the Kinect hardware. Currently, the library supports access to RGB and depth video streams, motors, accelerometer and LED and provide binding in different languages (C++, Python...)
This library is the low level component of the OpenKinect project which is an open community of people interested in making use of the Xbox Kinect hardware with PCs and other devices.1
git clone https://github.com/OpenKinect/libfreenect
cd libfreenect
mkdir build
cd build
cmake ..
Check that it marks no errors and no missing applications. Install whatever it marks and then proceed with the making.
make
The make command will connect to the Internet in order to download the audios.bin which is a firmware needed for the MS Kinect to work, without it the device won't be able to function properly.
sudo make install
cd ../src
python fwfetcher.py
This will create audios.bin file.I should copy this into a directory then the system will open it as firmware .
sudo ldconfig /usr/local/lib64/
Now I should create a new directory to add firmware to it.
cp -r /usr/local/include/libfreenect /usr/include/libfreenect
sudo cp audios.bin /usr/local/share/libfreenect/
Now plug the Kinect-360(v1) to the computer usb port and check the attached devices :
lsusb | grep Xbox
Test by an example :
cd ../build/bin
sudo freenect-glview # Without sudo there might be LIB_USB_ERROR
Note: if you get an error :
libusb couldn’t open USB device /dev/bus/usb/001/006: Permission denied.
Then run these commands:
sudo adduser $USER video
sudo nano /etc/udev/rules.d/51-kinect.rules
Add these lines :
-
Rules for Kinect-for-Xbox model 1414:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02ad", TAG+="uaccess" SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02ae", TAG+="uaccess" SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02b0", TAG+="uaccess"
-
Rules for Kinect-for-Xbox model 1473 and Kinect-for-Windows model 1517:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02be", TAG+="uaccess" SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02bf", TAG+="uaccess" SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02c2", TAG+="uaccess"
now after saving it , try theses commands before running ’freenect-glview’;
sudo freenect-micview
sudo freenect-camtest
sudo freenect-glview
Then Logout and then Login again .
sudo apt-get install libfreenect-dev
sudo apt-get install ros-melodic-freenect-launch
roslaunch freenect_launch freenect.launch
Set the Fixed Frame (top left of rviz window) to /camera_depth_optical_frame. Add a PointCloud2 display, and set the topic to /camera/depth/points. Turning the background to light gray can help with viewing. This is the unregistered point cloud in the frame of the depth (IR) camera. It is not matched with the RGB camera images.src.
In new terminal,
$ rostopic list
$ rqt_image_view /camera/depth/image
You should be able to see some image from the kinect device.
sudo apt-get install ros-kinetic-depthimage-to-laserscan
rosrun depthimage_to_laserscan depthimage_to_laserscan image:=camera/depth/image_raw
In new terminal
$ rqt_image_view
In new terminal
$ rosrun rviz rviz
Add the following nodes to launch file
<!-- The kinect node -->
<include file="$(find freenect_launch)/launch/freenect.launch">
</include>
<!-- The depthimage to laserscan node -->
<node name="depthimage_to_laserscan" type="depthimage_to_laserscan" pkg="depthimage_to_laserscan"
args="image:=camera/depth/image_raw" />