The goal of this project is to build a lego robot that wanders through a maze looking for a flame. When it finds the flame, it then positions itself to put out the flame and extinguishes it. The exact plan for how the robot will extinguish the flame is still under consideration. More on that will be covered in the progress section.
The robot is very compact and only does what it needs to. It has a left and right bumper rigged so that a hit directly on the front will activate a bumper aswell. It has two light sensors mounted above the bump sensors, and a fan mounted in between at approximately the same height. The two light sensors allow me to know when the flame is approximately centered so that the fan will put out the flame. The fan is hooked up to the RCX by attaching the two wires from the fan to two of the metal parts on the studs. (Trial and error to figure out which 2 of the 4).
The program that controls the extinguisher basically wanders avoiding obstacles until it sees light in one sensor, then adjusts to see the light in both, turns on the fan and moves forward. If it is slightly off from centered, when only one sensor identifies the light it will adjust again. In this way, the robot successfully extinguishes the flame each time it finds it.
Finally got movies of my robot. I have three movies, two of it successfully putting the flame out, and one of it getting confused in a corner (it did, for the record, get out eventually and put the flame out).
I think that overall the robot turned out pretty well, but that having a better maze navigating algorithm might have been nice. Now that the project is done, I wish I had taken a wall following approach rather than simply wandering. It probably would have been a lot more elegant. I loved working with the Lego RCX, it was extraordinarily simple, the only difficulty I ever encountered was getting the programs to download (which was frustrating and time consuming, but not too much trouble). I think if I did the project again I would set my sights a little higher, I feel like I accomplished a lot, but I think if I had had a slightly larger project I could have handled that too. I guess that's what I'll be doing in my free time this summer.
The demo yesterday went less well than the trial runs the night before, apparently my robot gets stage fright. In the next couple of days I'm going to run it and try to get a clean run to post here. I didn't make any major changes since 4-27, so here is the final code. The biggest things I did were making it play a sound when it believes it has put out a fire. Turning a random amount seems to have worked out, though I still ran into a few instances where it would mistakenly see a flame, particularly when right next to a brick. I was unable to find a suitable work around, but it happens so rarely there isn't much of an issue, and the robot is vigilant and continues looking for a flame.
The one major change that I made came after several runs where the light sensors had hit the brick and loosened and eventually fell off. I redesigned the front so that the fan and sensors were more secure to the frame, and added many bricks to strengthen the light sensors' towers.
I tried building a fan myself out of a lego motor, wheel, and some pieces of cardboard, but it didn't seem to be working too well, so while I was out one day I saw a small cheap fan and decided to buy it and use its pieces. I attached the motor to the lego input, and it is working just fine. The difficulties I'm still having are 1) having it not get stuck in corners/think the wall is light and 2) have it not just miss the candle to the left or right..its eyes are a bit narrower than the body, and I'm worried it won't see the candle if it is going past it. I think that the second problem won't be likely to come up, and that it should probably be able to keep going on its own. The first however, is trickier. I've added a random amount of turn so that it won't just get stuck in corners, but it still seems to perceive them to be light occasionally. Hopefully I can get it to recognize that it is not light, otherwise I may have to get some black construction paper to put on the walls of the maze. it is going quite well though, and will certainly be ready by the 29th.
So I finally took some pictures of my awesome robot. I also got a video of it finding the flame(lighter in this case) and slowly approaching it. Unfortunately it didn't *quite* realize it was close enough and just kind of charged the flame. Ahh well, it will just take some tweeking.
I continued working on vision, and figured out how to make it work. I set a threshold that seems reasonable for when it sees light. If only one of the sensors sees it then it turns until they both do. It then proceeds forward until the intensity reaches a second "close enough" threshold so that it will be close enough to actually put out the flame. I also found that one of the sensors consistently reads about 5% lower than the other (given the same light and distance) so I took that into account in my code.
I started working on the vision aspect (trying to find a light) and seem to be having trouble getting things working right -- until I realized I was downloading an old version. Good news is, I just found a great quick reference for lejos commands.
Last night I worked on adding vision components to my robot. I figured out how to rig up 2 light sensors and 2 touch sensors all at the same time so that I can affecively wander and also focus on light. I am starting to think about the code for making the robot move towards/ find the candle. Also, last weekend I worked on the Set Game and finished it, I think.
I've decided on using lejos, because its tutorial system is much more complete than nqc. I wrote a simple wandering client that goes forward until it hits something and then backs up and rotates accordingly.
I've finished building the first stage of the robot -- that is, I have a robot that can move and has bump sensors. I will have to rebuild or build onto it in order to make it a more reasonable height for flame extinguishing and I do not yet have light sensors.
I also have been looking into programming platforms NQC looks promising, although lejos looks as though it has a good tutorial. I plan to figure out which I'm going to use in the next couple of days.
The plan for this project is to, by the end of the semester, make a lego robot that wanders around until it finds a flame and then extinguishes it. The first half of the project will consist of first building the robot, then writing a program using either nqc, lejos, or legOS that will make the robot wander, avoiding walls, autonomously. The second half of the project will be focussed on flame detection and extinguishing. The most likely (it seems) way that the robot will extinguish the flame is by knocking it over, though a fan or some other device may be used.
Achieving Artificial Intelligence through Building Robots by Rodney Brooks.
Dervish: An office-navigating robot by Illah Nourbakhsh, R. Powers, and Stan Birchfield, AI Magazine, vol 16 (1995), pp. 53-60.
Experiments in Automatic Flock Control by R. Vaughan, N. Sumpter, A. Frost, and S. Cameron, in Proc. Symp. Intelligent Robotic Systems, Edinburgh, UK, 1998.
If at First You Don't Succeed... by K. Toyama and G. D. Hager, Proceedings, AAAI 1997. (pdf)
Monte Carlo Localization: Efficient Position Estimation for Mobile Robots by Dieter Fox, Wolfram Burgard, Frank Dellaert, Sebastian Thrun, Proceedings of the 16th AAAI, 1999 pp. 343-349. Orlando, FL.
PolyBot: a Modular Reconfigurable Robot Proceedings, International Conference on Robotics and Automation, San Fransisco, CA, April 2000, pp 514-520.
Robot Evidence Grids (pp. 1-16) by Martin C. Martin and Hans Moravec,CMU RI TR 96-06, 1996.
Robotic Mapping: A Survey by Sebastian Thrun, CMU-CS-02-111, February 2002
Robots, After All by Hans Moravec, Communications of the ACM 46(10) October 2003, pp. 90-97.
RRT-Connect: An Efficient Approach to Single-Query Path Planning by Steven LaValle and James Kuffner. (pdf)
The Polly System by Ian Horswill, (Chap. 5 in AI and Mobile Robots, Kortenkamp, Bonasso, and Murphy, Eds., pp 125-139).