-
Notifications
You must be signed in to change notification settings - Fork 11
Knife Game with DC Motor HAT and Solenoids
A mixed reality application of the knife game (https://en.wikipedia.org/wiki/Knife_game), demonstrating the impact of visual & audio perception on tactile perception.
The user puts their left hand's index finger in the case, and the experience starts. On the screen, the user can see an image of a virtual hand, with a virtual knife stabbing to the left and right of the virtual index finger. This is accompanied by an audible "tock...tock...tock", accompanied by the slight vibrations felt by the physical hand. Suddenly the knife on the screen stabs into the virtual finger, releasing virtual blood. At the same time the user feels a stab on the user's physical finger.
GIF of working prototype
<>
1x Raspberry Pi incl. Power Cable 1x Stepper & DC Motor HAT 3x Solenoids 3x Male-Male Jumper Wires (to connect to ground) 3x Male-Male Jumper Wires (to connect to power) External Web Cam MDF to build case
Raspberry Pi 2.x Spacebrew (local version on computer) Unity 2017.3.0f3 Python 2.7 (NOT 3) Adafruit Motor HAT driver https://github.com/adafruit/Adafruit-Motor-HAT-Python-Library (documentation here: https://buildmedia.readthedocs.org/media/pdf/adafruit-motor-hat/latest/adafruit-motor-hat.pdf)
Use example code https://learn.adafruit.com/adafruit-dc-and-stepper-motor-hat-for-raspberry-pi?view=all
Search for virtual hand and virtual knife on Google Poly (https://poly.google.com/) Animate the virtual knife by adding an Animator Component. Add an animation clip: record an animation clip of the knife going back-and-forth between the virtual hand's index finger, by recording in the Animation window and manually adjusting the knife's Position in the x, y, and z axis on the Animation record window (https://www.youtube.com/watch?v=JeZkctmoBPw)
Adjust the solenoid script, by using the animation event to trigger the respective solenoids.
You will need to hard code the position (x,y and z coordinates) of the virtual assets (virtual hand and virtual knife). Do note there is a glitch: when Unity isn't played, the position of the virtual assets is not the same as when the Unity file is played.
Laser cut MDF to fit three solenoids in an MDF box, which can fit a finger. Use black foam to block the casing entrance, to ensure that the index finger can only fit under the center solenoid. Ensure that the fiducial is visible to the webcam. For best effect, cover the entire setup such that the user cannot see their hands after putting it into the casing.