# Overview

AstroWheelie is a game based exercise platform designed to help wheelchair users get more physical activity. Its an Astroids clone written completely in PyGame. The original project, called Vectorpods is a LGPL game, and can be found here.

# How it works

AstroWheelie uses two Wiimotes (one attached to each wheel) to determine the position, rotation, and speed of the wheelchair. We use the cwiid library to interface with the Wiimotes, but similar support is provided on Windows through other projects (Friends have recommended GlovePIE). Cwiid is also a Ubuntu package (sudo apt-get install cwiid). I also have 3D printer boxes that have slots for the spokes on a wheelchair.

AstroWheelie decides what action the player wants to take by examining the effect of gravity on the accelerometers. The gravity vector is extremely clear on the Wiimotes (and on other accelerometers). I don't think its possible for a human to spin the wheels fast enough to distort the gravity vector to the point it can't be trusted. I put the wheelchair on cinder block so the wheels were off the ground and spun them. The vector distorts slightly at really high speeds, but it still points in the right direction.

If you use my classes, WiiData.py handles the low level grabbing of accelerometer data, and AccelInterfacer.py handles the high level stuff like calculating angular motion. I wrote this code to help me visualize the vectors I was getting from the accelerometers - its also a pretty good intro - www.cc.gatech.edu/~scuzzort/pyvec.py.

Important stuff for WiiData.py

1. Alway use GetLastestValue to get accelerometer readings
2. the init function has a text message telling the user to press 1&2 on the wiimote - if you plan to use a graphic, you might want to remove that.
3. Some of the stuff like run and GetRawValue are in there because the sparkfun version of the library needs threads to work well, Wiimotes don't. I didn't want to make a new interface, so I just kept some of the junk from the sparkfun version. Don't use these functions.

A few functions of note in AccelInterfacer.py

1. you must call Update to get a new value for ANY function in this class to work.
2. def GetReading(self) → returns an (x, y, z, rotation) tuple - originally the sparkfun accelerometers had an x axis gyro, Wiimotes don't have a gyro, so rotation = 0
3. def GetLastReading(self) → returns the old reading used to calculate angular movement
4. def GetReadingVector(self) → returns last - new position (i.e. gives you a movement vector)
5. def GetUnitCircleAngle(self) → returns between 0 and 360 degrees. This maps to where the accelerometer is on the wheel (this is calculated via gravity vector)
6. def GetAverageAngleDirection(self) → uses the old position (from GetLastReading) to calculate how much the wheel has turned

## Papers

AstroWheelie: A wheelchair based exercise game - www.cc.gatech.edu/~scuzzort/astrowheelie-cuzzort-starner.pdf

## Source Code

The source code as a zip file can be found at www.cc.gatech.edu/~scuzzort/Vectorpods-src.zip

## Contact Info

Stephen Cuzzort: scuzzort3 [at] gatech.edu