Motion-based controls for games have been around for decades, but even with the latest generation of virtual reality headsets, gaming is still done with relatively limited movement unless one has access to an expensive VR walking/running setup. As an effort to get more physical activity in, Iacopo Guarneri has developed a motion-capturing add-on that can be worn while on a treadmill, stationary bike, or elliptical to control in-game actions.
The wearable device itself is comprised of two components: an Arduino Nano and a six-axis MPU-6050 inertial measurement unit (IMU), which captures changes in velocity and orientation. Both of these parts are housed in a custom 3D-printed case that can be attached to the user’s back via a strap. In the sketch, the Nano continuously reads motion data from the IMU, packs it into a serialized representation, and sends it over serial to the host machine for further processing.
Unlike how running in a video game is performed by holding the left joystick up, the accelerometer outputs a sine wave in the Z-axis while the user is bobbing up and down, which necessitated the use of a smoothing function to prevent sudden stops and starts. Turns, however, are much simpler, as the user’s left or right tilt can be directly translated into sideways motion. Once both axes have been calculated, the virtual gamepad’s inputs are updated with the new values and sent to the game.