By Jimmy Alexander One of my favorite things about PiWars is the autonomous challenges. For this reason, my focus for this competition has been programming those challenges. My first major programming task I have been working on has been to try and solve mindsweeper… I mean minesweeper I don’t know why I keep doing this.
Our solution for minesweeper (got it right this time) started off by taking code we used last year for the Nebula challenge and modifying it for a new challenge. We even used the red plate from the nebula challenge to get started while we wait for a replica of the course to be made (cough, cough). The first thing that we did was put the red plate on the ground and run last years code as written. It worked the first try. Did you believe me? If you did then you probably have never coded before. On that first test the Hal decided that even though he had top performing code from last year that suddenly he was afraid of red. He ran away from the plate instead of going towards it. The redness must have reminded him of redrum or something. After some “quick” debugging, we realized that Hal’s brain had a little bit of a wiring issue. Or maybe us programmers wired him wrong. NOPE. Its definitely the robots fault and not user error. A few fixes later and last years code worked properly. After that fun little challenge we were back to where we were last year. So how do take Nebula code and modify it for mindsweeper (😊)? As it turns out it’s not as difficult as you would think. Once you finally get to a point where you can code. Which when your new battery system fry’s both your raspberry pi and your motor controller is not as fast as you would like. So after a quick upgrade to a raspberry pi 4 and re-installation of all the software, we actually were able to get a robot that drives to a red plate and stops extremely quick. While we wait for a closer replica of the course to be built, we currently have implemented a debugging section of the code that when Hal lands on the red plate he stops and waits for us to tell him that we moved the plate before he continues. If we don’t have that enabled he will wait a few seconds and then head to the next mine. He is super excited to show off his skills in Cambridge so he told me to tell you to say hi if you see him at the competition. Comments are closed.
|
Photo by Rock'n Roll Monkey on Unsplash
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2020
Categories |