Hi during autonomous mode I simply want to move my left foot and cause whatever is in the case structure, whether it be a motor or a frame to be activated. When I use the code below, a motor just keeps running which means that its constantly tracking my foot. How can I just make it work with a simple action like moving my foot.http://i174.photobucket.com/albums/w81/Luiz12_2007/FRC/5-1.jpg
The issue is that tracked means that the Kinect processing code knows where your foot is. It doesn’t mean that it moved. If you check that the foot is tracked and check that the position is different by a large enough amount, that would be a better trigger.
More than likely, you probably want to look at a single measure of the foot, just the Y if you want to raise it, just X if you step to the side, or just z if you step forward. And you will likely want to make it a relative compare, between the foot and hip for instance, and give it a threshold that you have to cross.
If you have an English sentence such as …
When my right foot moves twelve inches to the right of my hip, I want the pneumatic ram to push the basketball into the spinning flywheel.
then you can translate that into code. Discuss the sentence with the appropriate team members first so that you know what the trigger is, and then write the code. Post it if you want confirmation.
Yeah, your code is just saying “If the Kinect can see my foot, then do this code; if not, do this code.” You need to change the code to have it based on where your foot is. However, I have no idea how to do this… I believe you find the x and y coordinates of you foot, and then base your code on those numbers. But don’t make them exact numbers. Make then in a limit by using the “Range and Coerce” block from the comparison palette. It should allow you to base the cases on where your foot is. I would use this because your foot won’t be able to stay in one exact coordinate for more than a few milliseconds.
Hope I helped!