Maze time trials

For those who are interested in a little extra challenge, I’m looking for some groups to race their robots tomorrow!

I mentioned this informally to a couple of groups that seemed to be doing well in the final labs on Thursday and today, but I’d like to announce the following a little bit more formally to everyone. In tomorrow’s lecture, I’m hoping that a few groups will be willing to demonstrate their maze solving to the class, ideally with improvements like route optimization and driving fast. We’ll even see whose robot can get through the maze the fastest. There won’t be any bonus marks or physical prizes, but I hope that a few of you will be up for the challenge! It would certainly help with things like reference letters for future work terms.

Route optimization

As you saw in the video embedded in the lab 7 page, once you’ve solved a maze the slow way (e.g., using a hand-on-the-wall algorithm), it’s possible to go back and optimize the route. That is, after you’ve determined a correct route (and, in lab 7, stored it in an array of characters), you can inspect this route and eliminate dead ends to find a better route through the maze, one that takes no wrong turns. The procedure would then be:

  1. (as in lab 7) solve the maze, recording all of the turns you make,
  2. optimize the route,
  3. wait for another button press and
  4. “play back” the new route with the following simple algorithm:

    for i in [0, steps_in_optimized_route):
        follow segment
        turn according to optimized_route[i]
    

Driving fast

Most of the robots I’ve seen driving around in the lab have been moving at a very sensible but safe pace (PWM duty cycle of 40255). However, these robots can really move when you turn up the PWM settings! In tomorrow’s lecture, I hope we’ll see a few robots “turn it up to eleven”.

The procedure

What we’ll do in class, then, is give a few teams the opportunity to race against the clock on the big screens while others are filling out their CEQs. To keep things consistent and fair (and to give you the chance to try your hand at route optimization), the procedure will be:

  1. I will put your robot on a course at a place of my choosing (which will be the same for all groups),
  2. you will tell your robot to run your solveMaze code,
  3. I will place the robot back at the same starting point and
  4. you will tell your robot to run through again as fast as it can go.

The fastest robot will, undoubtedly, will the admiration of your peers (?). It will also, hopefully, be a fun way to end the term.