For one of my modules during my first year at university, I created a glove that could be used to play a small game I made.
The glove tracks hand rotations and finger bends. I made it from a wetsuit glove, and used an Arduino to process readings.
First I ensured the finger bends were read correctly. This used variable resistors, the resistance of which varied by the angle the resistor was bent to. Each resistor had a different level of inaccuracy, (they were fairly cheap), so I had to create an offset for each.
I then wired up a gyroscope so I could monitor what angle the user was holding their hand at.
I modified a 2012 sketch file by Jeff Rowberg to give me the yaw, pitch, and roll of the gyroscope.
To check it was all working, I mapped the euler angles onto a cube.
Finally, I wrote code in C# to declare whether each finger was bent or not, which was along the lines of
if resistance is less than x
finger is not bent
finger is bent
Mapping the angles read from the glove onto the cube helped with allowing the user to aim. I put the cube behind the game camera, and did a raycast out of the front of the cube (equivalent to the front of the glove). This allowed the player to select objects.
There were some problems to overcome with this project. The first was making sure all processing was done by the computer the glove was connected to, not the Arduino. This was initially easy, as I just had the Arduino read the data from the glove and send it to the computer. However, I found that the Arduino sent information so quickly that Unity would lag and crash. I overcame this issue by having a separate thread for processing the data received from the Arduino.