The zipped file listed below contains the three Android activities required to get the robots to perform simple, colored ball, following. We use 2.5″ – 3″ Styrofoam balls painted in matte colors (red, green, or blue). Styrofoam and matte colors work well because they reduce the glare that otherwise makes the color hard for the phone’s camera to pick up under some circumstances. Although we use balls the code picks up any rectangular object of the given color. With multiple objects it focus on the one that appears largest.
Note that the code tries to stay a constant distance away from the detected object, about 18″ for a 2.5″-3″ ball. With larger objects the robot will attempt stay further away (backing up when necessary to retain the desired distance) and with smaller objects will attempt to stay closer.
Installation instructions and documentation: DocumentationCotsBotsBallFollowingV1
Zipped .apk files: http://www2.cs.uidaho.edu/~tsoule/cotsbots/BallFollowing.zip