Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Microsoft Kinect with myRIO (update)

This guide will describe how to use Kinect on myRIO through the USB port. This involves setting up libfreenect libraries on the myRIO, and testing it with an example project. This library only contains basic APIs to read raw RGB image and depth image from Kinect. Other functions such as audio, 3D skeleton abstraction are not included.

Instructions:

A. Download the attached 2 zip files.

     The "KinectLib.zip" contains libfreenect library files and the "Kinect Project.zip" contains the example Kinect VIs to use the library to read data from Kinect.

B. Setting up libfreenect Library.

     Requirements:

     In order to complete this part of the tutorial you will need software to SSH into your myRIO. This example uses PuTTY. You will also need to use SFTP to transfer files to the myRIO. This example uses FileZilla.

     Steps:

     1. Connect myRIO through its device USB port to your PC.

     2. Enable SSH. Go into NI MAX and find your myRIO under Remote Systems item in the left pane. Browse to your myRIO. In the System Settings tab of the device, under Startup Settings, there should be several checkboxes. Enable the box to the right of “Enable Secure Shell Server(sshd)” if it is not already. Hit Save.

     3. Connect to the myRIO with SFTP. Username is 'admin' and Password is left blank.

Capture.PNG

     4. Copy over libfreenect.so.0.1.2, libfreenect_sync.so.0.1.2 and libkinect_wrapper.so in /user/lib folder on your myRIO. And copy liblibusb.so.1.0.8 to /usr/local/lib

     5. Open an SSH connection with the myRIO. User is admin and password is left blank.

     Capture2.PNGCapture3.PNG

     6. Create symbol link to these files through the following commands in your PuTTY.   

     =============================================================

     #ln -s /usr/lib/libfreenect.so.0.1.2 /usr/lib/libfreenect.so.0.1

     #ln -s /usr/lib/libfreenect_sync.so.0.1.2 /usr/lib/libfreenect_sync.so.0.1

     #ln -s /usr/local/lib/liblibusb.so.1.0.8 /lib/libusb-1.0.so.0

     =============================================================

     7. Reboot your myRIO and your libfreenct library should be ready to go.

C. Run Example


Software Requirements:

  • LabVIEW 2013
  • LabVIEW Real-Time 13.0.0 - NI myRIO 13.0
  • Kinect Example VIs (attached)

Hardware Setup:

Connect your Kinect to the myRIO USB port and powered it by the wall adapter. Also, you can power Kinect with a external 12V DC. To make sure your Kinect is working properly, again SSH to your myRIO and type the following commands to check whether all Kinect USB devices are correctly mounted. And you should be able to see three USB devices in the list: "Xbox NUI Audio", "Xbox NUI Motor", "Xbox NUI Camera". If you cannot see them, make sure your Kinect is correctly connected.

     ====================================================

     #cat /proc/bus/usb/devices

     ====================================================

Capture4.PNG

Software Overview:

In the included project, there are two top level VIs which can be run after the Kinect is connected, and the libraries are installed on the myRIO.


Kinect Depth Controller has controls for the Depth Resolution and Depth Format, as well as the LED option and Tilt Degree. All depth formats and resolutions should work (NOTE: resolution and format have to be set before the program is run, and don’t have effect while the program is running). Tilt degree controls the motor inside of the Kinect that rotates it. LED option controls the LED on the front of the Kinect.


Depth resolutions: Tiny (160x120), Low(320x240), and Medium(640x480)


After Init Kinect Systems has run, any of the Vis that read depth or video data from the Kinect should work (exceptions for video resolutions noted below). It is important that Close Kinect Systems is called (use stop button, don’t abort); if it’s not executed, on next execution of the VI the myRIO will lose connection immediately. However, running it again after the disconnection will work.


Kinect Video Controller has the same controls as Kinect Depth Controller, but this time the Video Resolution and Video Format controls will take effect (again, these must be set before executing the VI). NOTE: as of right now, none of the video formats work in Low(320x240) resolution, all of the formats work in Medium(640x480) resolution, and only RGB and Bayer formats work in High(1280x1024) resolution.


If you will be doing image processing, or converting the depth to physical units, the projects on Obstacle Avoidance and Color Following with the Kinect have examples of this. Basically, you will want to modify the Read Video or some Read Depth VI so that you get the 2D array of points instead of the picture. From there you can convert it to an IMAQ image and process it with IMAQ functions.


The lower resolutions for both Video and Depth are much faster than higher resolutions. In the other projects, we’ve been getting about 15fps on tiny depth resolution, and ~3fps on medium resolution video.

Kinect VIs & Wrapper library

Credit for the Kinect VIs and wrapper code goes to Vicentiu Neagoe, Mihai Serban, and Adrian Papp.

This is a updated version of the original documentation written by erik.j.o

The attached "Async_wrapper.h" is the c header file of this library.

Download All
Comments
DDHITO
Member
Member
on

Hello hasan!

Thank you for your reply! After i verified the cache, i found the result is totally different with yours due to my mistake,i try carefully typing the line you gave me, but when i try to install it failed again... Is there anything i have to do with the wrong thing i have done before?

                                 THX

QQ图片20160414093957.png

DDHITO
Member
Member
on

Hello BradM

I tried ls -s /usr/... and load install again but failed, is there any thing goes wrong?

QQ图片20160414101656.png

QQ图片20160414101622.png

Fatik.Hasan
Member
Member
on

Reset the myRIO.

Go to NI MAX, right click on your device under Remote Systems tab and click Format Disc.

Then restart myRIO, use the "Getting Sarted with myRIO" wizard to install software on NI myRIO.

Make sure that the myRIO doesn't disconnect or you don't lose electricity during the process.

Again, copy the libraries to the mentioned locations in myRIO using fileZilla nad run the lines of code that <fatikhasan> posted.

Restart myRIO.

Your kinect should be ready to go.

Also, this doesn't work with LabVIEW 2015. My recommendation is the use 2013.

DDHITO
Member
Member
on

hello hasan

i try many times but still couldn't make it work. I had reseted myRio and check everything

QQ图片20160414214610.png

i can see all device working well, but just can't make libusb-1.0-0 work

QQ截图20160414215132.jpg

DDHITO
Member
Member
on

I am stuck in the same place , how could i open the VIs and adjust the CLFNs? And I am using Labview 2014, is that relavent to the problem i got?

BradM
Active Participant
Active Participant
on

DDHITO,

Why are you trying to install libusb through opkg? The library that is needed (which is liblibusb, not sure why it's labeled that way) is in the zip file attached to the project description. Please make sure to follow the instructions carefully, taking note of any error messages or warnings that may happen during running any of the commands.

DDHITO
Member
Member
on

BradM

I do tried carefully, plz help me out ToT.

QQ截图20160415112748.jpg

QQ截图20160415112830.jpg

QQ截图20160415112842.jpg

QQ截图20160415111300.jpg

QQ截图20160415111810.jpg

QQ截图20160415112403.jpg

BradM
Active Participant
Active Participant
on

DDHITO,

That seems correct. What does the output of ldconfig -p | grep usb show?

By the way, if you're using PuTTY, simply selecting the text in the window will copy it to the clipboard, if memory serves me.

DDHITO
Member
Member
on

BradM,

This is what the output of ldconfig -p | grep usb shown

QQ截图20160416101442.jpg

sometimes the clipboard doesn.t work properly, i always select the text and press Ctrl+P.

DDHITO
Member
Member
on

BradM,

This is Why I am trying to install libusb through opkg          https://decibel.ni.com/content/docs/DOC-31239

QQ截图20160416102352.jpg

this is the return of it

QQ截图20160416103134.jpg

fatikhasan
Member
Member
on

DDHITO.

Don't type "#" while typing lines of codes in putty. Directly start from ln -s ...

This is the only problem.

DDHITO
Member
Member
on

Fatikhasan

It works!!!!!!!!!!

Thank you Bro!!!!!!!

QQ图片20160417110320.jpg

DDHITO
Member
Member
on

BradM,

Thank you for your patient, and your time, it works properly!!!

fatikhasan
Member
Member
on

BradM,

The mistake that enthusiats are making in this tutorial is that they are typing "#" while executing the commands in putty. The rest is good. I also did this mistake back while I was interfacing Kinect with myRIO.

Though I learnt alot from you and discovered more about LabVIEW and myRIO. Thanks for all the support you gave me, and all the other members of the community.

DDHITO,

Congratulations! Do tell me what project you're working on with Kinect and myRIO.

DDHITO
Member
Member
on

Hello faithhasan.

Sorry that i missed your comment. I am working on a project called Obstacle Avoidance AGV as my graduation project. I am using MyRio with kinect to contral a four Mecanum wheel AGV.

L_NG
Member
Member
on

Hi I'm new here, I'm using XBOX 360 Kinect (Model 1414), NI myRIO 1900 (18.0), Labview 2018.
in my NI MAX, myRIO did detect the device as Xbox NUI but in USB instead of "camera".

Tab.JPG

I did the steps as shown in this forum, but mine looks nothing like the one that almost everyone here get...
using Puttyusing Putty

I don't have the " /proc/bus/usb/devices " directory but I do have this directory "/proc/bus/input/devices" . 

I have connected XBOX 360 Kinect to myRIO using USB and also supplied the Kinect with the wall plug, Power up the myRIO with wall plug as well.

The XBOX 360 Kinect has yellow light blinking as well

 

Can anyone help me with this? ...

Contributors