In my robotics class in early December of 2015, we were assigned a project concerning the LEGO EV3 robots. We had to design, build, and program the EV3 robots so that they could win in the RoboSumo Competition. The RoboSumo Competition is a competetion wherein two LEGO EV3 robots enter a white ring traced by a black outline, and they must stay in the ring for the entirety of the match (two minutes) unless the other robot is 75% out of the ring. We could use any approach we wanted to use, but we had to use at least three sensors that are vital to whatever program we write for the robot. The goal of this is to design and program a robot that will be able to autonomously navigate the ring while making sure the robot stays inside the ring, and also to try and make the other robot exit the ring. There are many different approaches and tactics to this problem, and we decided to make the robot mainly offensive. There is an arm on the front of the robot that serves as a lifting mechanism. The purpose of that arm is to get under the other robot and lift it off of the ground, at least partially. Thus, there'd be less friction and it would be easier to push the other robot out of the ring. On the back of the robot there is a sloped wall for defensive purposes. If the opposing robot charges our robot from the back, it will usually run up that wall and the topple over. There is a border we built around the perimeter of the robot that doesn't interfere with our other mechanisms, but instead deters attempts to flip our robot, since the other robot won't be able to get under our robot. We also granted ourselves one neat, if not particularly useful, gadget. On the left side of our robot, there is a gadget that spins continuously, with three arms reaching out in an effort to look neat and maybe hook on to the other robot in some way. On the right side is a touch sensor that, when touched, makes the robot spin around and attack whatever just triggered the sensor. Of course, all of this falls apart without proper programming. We started familiarizing ourselves with the software by making a simple taskbot with the EV3 at the beginning of the project, Over time, with lots of trial and error, we got the hang of the EV3 programming. The way that our final program works is that the robot first enters the ring, the it begins to move forward within the ring until the color sensor, placed directly underneath the robot, detects a dramatic in change in color, between the white ring and the black outline.. Once this change is detected, the robot moves backwards and turns ninety degrees. This behavior is set on a loop until the program is manually stopped. We added a fun, though perhaps useless gadget on the side, a spinning windmill with claws. Did it perform any real useful function? Maybe not, but if you're making a fighting robot, you have a right to have some fun with it. And when the competition came around, to our surprise (and ecstasy) we won! Our robot survived multiple rounds with a wide array of differently designed and differently built robots, and after much hard work and an overwhelming amount of fun, we had accomplished our goal. Chris Johnson and I won first place in the RoboSumo contest in our freshman year.
Tic-Tac-Toe Robot
In my sophomore year of high school I was given an open-ended assignment, my only real objective being to build a robot, write some pseudo-code, and write some real code. I'd been given a list of standards I needed to accomplish, and I could do that in any way I pleased. I tried to think of different projects applicable to building and programming a robot, and the idea struck me to make a robot that could engage a human in a game of Tic-Tac-Toe. Easier said than done. I had to first decide the mechanisms of the game; what approach would the robot use to win? This changed a little over the course of construction, but the idea was to use the "Three Corners" tactic, in which a player tries to fill any three corners as soon as possible, because that theoretically allows them three different ways to win (Corner A to B, Corner A to C, Corner B to C). You might be thinking, "Couldn't the opponent just block one way to win?", and yes, they could, but there would still be two more guaranteed ways to win. However (and this is something I realized while looking into the dynamics of the game), if both players are playing their best game possible, it'll be a draw every time. Tic-Tac-Toe is a game reliant on mistakes and missed opportunities. Because I'm writing this after the completion of this project, I can't tell you my exact train of thought, but I'll tell you the results. I decided that corner boxes were separate entities from the other boxes, especially since this program relies on the corners. So, I made a Tic-Tac-Toe board and labeled the four corners A, B, C, & D, and the other boxes were labeled 1-5. The robot would go first, and would always start in Box A. It didn't really matter what corner it chose to go in first; each move the robot made was made relative to the first. Then the opponent would go. The robot would ask a series of deductive questions to determine where the opponent went. If boxes 1 or 2 were marked (meaning the opponent was blocking a horizontal or vertical play), the robot would go in Box 3 (hoping for a diagonal win). If Box 3 was marked, the robot would go in Box 2 (hoping for a vertical win). And if boxes B or C were marked (blocking a horizontal and vertical play, respectively), the robot would mark the opposite corner box. Boxes 4, 5, and D didn't really matter this early in the game, since the robot is only trying to get three corners (A, B, and C). If Boxes 4, 5, or D were marked, the robot would mark Box C.