Pololu 3pi Maze Traversal
Project Background

One of my favorite assignments in my Computers in Engineering class, however stressful at the time, expected students to program a Pololu 3pi robot to traverse a maze of black lines on a large sheet of paper using light sensors and motors to control its wheels. Our professors had provided libraries containing code designed to handle interfacing our maze-traversal code with the motor control and light sensors on the robot since the relationships driving them were complex. Students were tested on their ability to program the maze-traversal component of the code, which in itself was quite the task. It was realistic, however, as pre-made libraries tend to exist for similar complex systems driving the basic motion functions of a robot.

We needed to create a main program that would allow the device to move along the black line, careful not to leave it, recognize end points in the maze, and then store their locations and arbitrarily generated values attached to them as nodes in a linked list. Then, upon finishing the loop and arriving back at the beginning, the device would traverse back to the node which held the highest random value and play a small song upon arriving. It would then return to the starting point on the map and begin again, playing until the battery died.

This project expected partners to collaborate to write the code. That is usually a difficult thing to accomplish, as most software only allows one person to edit a program’s code at a time, and because of the often-major differences between two people’s approaches to a coding solution, but my partner and I contributed ideas and searched for errors while taking turns writing the base code. It took a total of 12 hours in front of the computer to iron out the inconsistencies in our code, allowing the robot to move straight on the line instead of jittering and missing turns, but we did get it to successfully finish the course.

  • LinkedIn
  • YouTube
  • Facebook