At first, we had a very elaborate plan involving several different interacting sensors and behaviors. We wanted the mouse to search for a piece of cheese and run away from the cat – the mouse would speed us if the audience was loud enough or if it saw the cat. If the mouse gets the cheese before the cat catches the mouse, the mouse would run into a hole and win the round. The cat, on the other hand, would speed up if it was chasing the mouse and do a little dance if it caught the mouse. The winner would be determined by who obtained their goal first.
Final Product
By the exhibition, we ended up with a program that worked decently well. The mouse would run around in a random path, which tended to leave the mouse either stuck by a wall or aggressively attacking the cat. The cat, on the other hand, was slower but able to follow and catch the mouse.
Programming
The mouse’s behavior was programmed to go straight until its bumper hit a wall or an object. Then it would either back up or move forwards, depending on which bumper was hit, turn a little bit, then resume going forward. The cat’s algorithm was written so that it would keep turning in a circle until it detected the mouse’s tail light, in which case it would move in a zig-zag line towards the mouse. If the cat saw the light and hit its front bumper, it would stop and play a few notes from the opening of Beethoven’s Fifth Symphony.
Functional Sensors
Both the cat and the mouse were equipped with HandyBoards. The mouse was equipped with two touch sensors – one in the front and one in the back. It was also equipped with two motors and a light bulb that ran from a separate battery source. The cat was equipped with two motors and two infrared light detectors.
Whiskers
Worried that the touch sensors, especially the one on the cat’s small head, would not react unless the cat hit an obstacle head-on, we tried using whiskers and two touch sensors in the front to cover a larger impact range. The paper-clip whiskers were very sensitive to touch; however, they had trouble staying attached to the animals and kept dragging – and activated – on the floor, so we ultimately scratched the idea.
Sound Sensor
We had created our own sound detector. Originally, we thought that it would be great to have audience interaction by making the mouse go faster the louder the crowd. However, the sensor readings were too unreliable to be of much use.
Mouse “Sight” – Since mice are supposed to run at the sight of a large, pouncing cat, we wanted our mouse to run away too. As it turned out, the mouse was a bit speedier than the cat. In addition, we had some trouble getting the cat to detect and chase the mouse, so we finally decided to implement a fairly simple program into the mouse.
Magnet Sensor
Halfway through the week, we realized that we needed some way of getting the cat to recognize that it had “caught” the mouse. We decided that because magnet sensors worked in close ranges only, we would stick the mouse with magnets so that once the cat hit the mouse, it would burst into song and dance. However, in the end, we solved the problem by simply having the victory dance be triggered when the cat sees the mouse’s light at the same time the cat’s front bumper was hit.