Readings for HW 4:
Robot Evidence Grids (pp. 1-16)
by Martin C. Martin and Hans Moravec, CMU RI TR 96-06, 1996. (pdf is reversed)
Robots, After All
by Hans Moravec, Communications of the ACM 46(10) October 2003, pp. 90-97. (pdf)
One important requirement of this remote-control client is that you make the space-bar a "stop" command... . You never know when you'll have to stop immediately!
Try out the software with the ER1's USB camera (feel free to unattach the camera and plug it into the USB port on the computer). In particular, this file (visionNotes) has a brief explanation of most of the features of the Vision tool.
Your task is to implement the two functions RGBtoHSV and processRed, so that the tool demonstrates (1) what pixels it thinks are red, (2) whether or not the camera is currently facing a red molding (through the center of the image), and (3) an estimate of the location/slope of the red molding in the image. You may write RGBtoHSV based on our class coverage of it, or simply go online to find one of the many available implementations. However, be sure you know the ranges of the hue, saturation, and value (intensity) bands.
Your program should highight those pixels it thinks are red in a distinctive color, it should indicate graphically when it sees a red molding (for example, have something appear or change color), and it should draw the line at which it estimates the molding's position, when present. Each part is worth 7 points. (Everyone gets the extra point...) A suggestion for making your code easier to tune is to use key presses to change your RGB/HSV parameters on the fly. You will definitely NOT want to recompile everytime you want to change your definition of "red."
The servo motor creation page provides the details you'll need to create the connectors and circuit for the sonar.