View Full Version : Kinect Boolean Programming
I've been working on the programming for our Hybrid/Autonomous mode and I have one important problem to solve...
At the competitions alliance teams must "choose" which member of the alliance will use the Kinect during the Hybrid Period. If you are the team to be selected, you would place the USB at the operating console into your laptop to activate the Field Kinect from the Kinect Station.
So here's my question:
How would you be able to detect in Labview (and Java) if the USB for the field Kinect is in the laptop or not. I believe it is similar to the Boolean involved in detecting if a button on a controller is pushed or not, but its not in my certainty to guess....:confused:
RufflesRidge
22-01-2012, 20:01
There are a number of options to do that using the data that will come in if you do have the Kinect plugged in and it's sending data to your robot. The easiest is probably to query the Number of Players and do Kinect stuff if it's 1 and non-Kinect stuff if it's zero. You should also decide what to do in the case that it's greater than 1 even though this shouldn't occur during competition.
The code to do this is obviously very different in the two languages, but I believe the Gesture Processing samples (unfortunately I don't have them on this PC to check) for both languages show how you would do this if you need help.
Thanks for the info, but is there a specific block in Labview to use? (i.e: JOYSTICK Open, DRIVE 4-Motors, GYRO Close)
RufflesRidge
22-01-2012, 20:23
Thanks for the info, but is there a specific block in Labview to use? (i.e: JOYSTICK Open, DRIVE 4-Motors, GYRO Close)
Unfortunately I don't remember which block the number of players comes from in LabVIEW, it's definitely one from the Kinect palette. I think it's the Kinect Header, but Kinect Extra may also be a possibility.
MotorHead
22-01-2012, 22:14
I think this thread addresses one way to do what you want:
http://www.chiefdelphi.com/forums/showthread.php?t=100643
Thanks, Jeff, I'll see if I can Figure it out.:]
Well, guys, I do believe that I have figured out a few ways to program this section in Autonomous/Hybrid. I am extreemely sure that these are some ways to go around this...
In the first picture, I didn't write a program in the false case block for the first scenario, I just entered some other programming options...
What do you guys think?
I have my examples for the kinect detection options, and I just need some quick feedback on it...
What do you guys think?
We are within 2 days before we have to stop testing the main robot...
Are the Examples I have given you a good way to tell the Autonomous/Hybrid program which program should run?
RufflesRidge
19-02-2012, 11:18
I would get rid of the two small case structures inside. Just put your non-Kinect auto code there. If there are 0 players, either the Kinect isn't being used or your player is not detected, either way you want to just run auto. If there are two players, you are not necessarily going to get good data from the Kinect so I would just run the auto code there as well. This means that if "players" is anything but 1, you want to run your auto code, which is what your larger outside case structure will do.
I would get rid of the two small case structures inside. Just put your non-Kinect auto code there. If there are 0 players, either the Kinect isn't being used or your player is not detected, either way you want to just run auto. If there are two players, you are not necessarily going to get good data from the Kinect so I would just run the auto code there as well. This means that if "players" is anything but 1, you want to run your auto code, which is what your larger outside case structure will do.
Oh, I didn't mean for the two inside structures to mean that it is a part of the program, I just put them there to show different examples...
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.