Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Programming Kinect (http://www.chiefdelphi.com/forums/showthread.php?t=101087)

nydnh01 24-01-2012 22:11

Programming Kinect
 
I am having trouble locating a proper example of how to program the kinect in Labview. Please post any of your examples which can help me program kinect in labview.

rachelholladay 25-01-2012 01:59

Re: Programming Kinect
 
We Beta Tested the Kinect and the YouTube demonstration can be seen here http://www.youtube.com/watch?v=IYhxqsj70VY

Also, once build season had started, we wrote a manual of sorts to try to help pass on our lessons learned as well as give instructions on hardware and software setup. There are some example code snippets included.
http://team1912.com/docs/kinectmanual.pdf

zaphodp.jensen 25-01-2012 08:53

Re: Programming Kinect
 
We have been programming our own custom routines, and that has worked out great for us. I wrote a Kinect Array to Cluster VI, that generates a Named Cluster that you can just Unbundle. This cleans up the Code, because you do not need an Index Array for every value.

I'll include the VI, and some sample code for everyone's convenience. It took me about 2 hours of naming and Indexing the Array to properly get the Cluster, so please give reference to Team 3130, the E.R.R.O.R.'s.

RahatAhmed 25-01-2012 09:11

Re: Programming Kinect
 
Quote:

We have been programming our own custom routines, and that has worked out great for us. I wrote a Kinect Array to Cluster VI, that generates a Named Cluster that you can just Unbundle. This cleans up the Code, because you do not need an Index Array for every value.

I'll include the VI, and some sample code for everyone's convenience. It took me about 2 hours of naming and Indexing the Array to properly get the Cluster, so please give reference to Team 3130, the E.R.R.O.R.'s.
Did you have to do anything to get your kinect to communicate to the robot? Our driver station picks up the skeleton but the robot doesn't seem to be able to connect to the Kinect.

inkspell4 25-01-2012 09:15

Re: Programming Kinect
 
Could you post your code as an example

nydnh01 25-01-2012 10:17

Re: Programming Kinect
 
According to the National Instruments example it shows that the kinect uses an index array to get the hand gestures but when connecting the kinect extra class it does not give that option to use the hand for the gestures.

zaphodp.jensen 25-01-2012 13:34

Re: Programming Kinect
 
2 Attachment(s)
Here is the code for the Cluster VI. This needs no modification to work.

The example code is purely example code, and has two fairly simple examples to look at. The code can be placed into the autonomous loop, and then deployed.

Please give reference to Team 3130, the E.R.R.O.R.'s.

zaphodp.jensen 25-01-2012 13:36

Re: Programming Kinect
 
As a side note, you should check out the internal workings of my VI. Now imagine having an index array everywhere that you need a vertex broken out. An unbundle by name works extremely well for this purpose.

zaphodp.jensen 25-01-2012 13:42

Re: Programming Kinect
 
Quote:

Originally Posted by nydnh01 (Post 1113223)
According to the National Instruments example it shows that the kinect uses an index array to get the hand gestures but when connecting the kinect extra class it does not give that option to use the hand for the gestures.

You are correct. The Get Kinect Extra VI actually grabs extra data relating to actually tracking. What you use to get the Vertex is the Get Kinect Vertices, and then normally, you use an Index Array to get the actual vertex info. I use my VI, which converts that array into a named cluster, which can then be unbundled.

Greg McKaskle 25-01-2012 15:22

Re: Programming Kinect
 
1 Attachment(s)
I'm happy to see that you wrote a converter to a cluster, but there are a few things worth mentioning.

You can grow the index array and it will extract the next element without an enum cluster wired up. That syntax shortcut comes in handy pretty often.

I attached an alternate implementation that keeps the original cluster order (which matches the Microsoft header file), and uses some casting to simplify the diagram. I also attached a typedef for the cluster. Because ctls are not a supported upload type, they are in a zipped folder.

Greg McKaskle

zaphodp.jensen 25-01-2012 16:07

Re: Programming Kinect
 
The only reason that I had the enums wired up was because I was not sure as to what the order of the array was going to be, and I wanted them to be in a specific order in the cluster.
If you do not know the order of the array, it is always safer to wire in all of the enums to ensure that the output is the correct value from the array.

But thanks for the code anyways!

SuperS_5 25-01-2012 23:19

Re: Programming Kinect
 
Quote:

Originally Posted by Greg McKaskle (Post 1113398)
I attached an alternate implementation that keeps the original cluster order (which matches the Microsoft header file), and uses some casting to simplify the diagram.
Greg McKaskle

Hey Greg, thanks for the converter VI, could be useful but noticed one thing. The array to cluster function was left at the default of 9 elements. It would have to be set to 20 if you want the whole control to be casted.


All times are GMT -5. The time now is 11:41.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi