KINECT WITH SCRATCH
Getting Started: Initial setup Be kind and gentle with the Kinect Setup Install the monitor mount Attach the Kinect Plug the Kinect into the wall/power strip Plug the Kinect into a USB port Wait for drivers to finish install Install Python from public server Add to system PATH: c:\python27;c:\python27\lib;c:\python27\scripts Run get-pip.py from Kinect utility folder Open a command prompt (Windows key + R, then cmd.exe) CD\Python27\Tools\Scripts Now inside the command prompt black window: pip install flask pip install flask-cors pip install pykinect pip install greenlet Copy Kinect2Snap folder from public drive to your machines C: drive (the root folder) Run gevent installer from Kinect utility folder Go to Kinect2Snap folder in C: drive, double click server.py Copy Sample for Snap.xml from Kinect utility folder, and import into Snap
Every day setup (4 th period) Plug in the Kinect to the wall and to the PC Go to the This PC, C: drive, open Kinect2Snap, and open server.py
Tear down at end of day (5 th period) Tear down Quit Scratch, Kinect2Scratch, unplug everything, put it all carefully back in the box and store the box
Basic Sensing Find all of the new sensor variables in the Sensing group Each has X and Y values Skeleton Example: In a forever loop: Pen lines are drawn between the joints Sprites are placed at each joint
The Kinect Data Kinect data comes to Snap from a mini "web server" The http blue block asks the server for kinect data Use skeletons/2 to get data for a second player The split green block turns that data into a list of data points We set variables to the items in the list This forever loop on the stage constantly updates the variables
The Kinect list of data The list has the info in the order to the right There are 20 skeleton joints listed Each one takes up 3 places in the list Example: footleft X position is slot 1, Y position is slot2, and Z position is slot 3 Starting (X) slot is listed for each footleft1 footright4 ankleleft7 ankleright10 kneeleft13 kneeright16 hipcenter19 hipleft22 hipright25 spine28 handleft31 handright34 wristleft37 wristright40 elbowleft43 elbowright46 shouldercenter49 shoulderleft52 shoulderright55 head58
Sensing - Interaction Click buttons using sprites Have a sprite follow your hand When sprite touches button sprite, cycle colors for 1 second before “clicking” What other kinds of interaction are there? Swiping Pinching/Stretching Gesturing (look for movement shapes)
Sensing - Movement Use movement to trigger events Look for movement of a point in time (use Timer) in a specific direction, or compared to other points (such as hand above head) “Grab” sprites and “Throw” them Have a sprite follow your hand When it touches another sprite, grab it (move it with the 1 st sprite) When you see rapid movement, “release” it in the direction of movement What other things might you capture movement for? Dancing games Music games (play the piano, drums, other?)
Sensing – Controlling variables Use two points to create an angle setting – hand to shoulder Slope = (y2-y1) / (x2-x1) Angle = Inverse Tangent of slope: Operator = ATAN Look at Angry Shark project for a refresher on trajectories Distance between points = launch speed Another gesture to “fire” Shoulder (X2, Y2) Hand (X1, Y1) Slope = rise / run Run Rise TAN ɵ = Rise/Run, so Angle ɵ = ATAN(Slope)
Kinect Project Groups of 4 At least 2, and up to 4 player game (one or two players at a time) You get to decide the game Details described in project spec Divide the tasks up, but work together to get it done Leverage code youve done previously!
Teams – 4 th Period Team 1 Hamza Shafique Manon Modal Cameron Hill Blake Barrett Team 2 Connor Knutson Sarah Ahn Nick Doan Isaiah Shim Team 3 Donovan Bahall Annika Hildebrand Dustin Bowcutt Joseph Bluett Team 4 Chase Cleary Grace Miao Dane Petterson Thomas Guilbert-Newell
Teams – 4 th Period (continued) Team 5 Sebastian Miller Addisen Tucker Max Evdemon Team 6 Sikali Vidal Marley McVay Tushon Barquet Sam Cormier Team 7 Alex Luzhnov Tianna Cooper Hunter Kiphart Team 8 Mustafa Masud Isabella Paxton David Shiroma Brendan McKlintoc
Teams – 5 th Period Team 1 Ben Siroka Hudson Vogel Noah Kim Brooke Sypher Team 2 John Gibbons Klarity Riesen Alex Nickel Hannah Robison Team 3 Carter Shane Eliza Gutke Andrew Burger Nathan Dunn Team 4 Andre Woods Joey Rosauer Ali Hirayama Josh Banerjee
Teams – 5 th Period (continued) Team 5 Nick Cardenas Emma Patterson Daniel Shomaker Julia Hepperle Team 6 Jeremy Chang Avery Escobar Sofia Olson Justin Cavagnaro Team 7 Paul Kim Ethan Cruz Talavera Alysse Legault Henry Bainivalu Team 8 Nathan Mills McKenzie Gonzales Ankur Garg John Christison Team 9 Makena Booth Frederick Jarvis Andrew Fox