Process:
Making the world: Before we started with coding the robot, we first had to make a world for it to navigate. We taught ourselves how to construct this world and then created one that we felt showcased all of our robots abilities (line tracing, ultrasonic sensing).
Choosing the bot: One main obstacle with this project was figuring out how the sensors interact with the code and the world. At first we were confused why our ultrasonic distance sensor wasn't working, and then we realized we had a bot selected that didn't even have one. Then we were confused why our bumpers were failing before taking a closer look and realizing the bumpers were actually on the back of the robot. This led to a lot of troubleshooting as we had to make sure our code worked logically for where the sensors were physically on the robot. At one point, to make the bumpers operate, we had to turn it around 180 degrees and go through the course backwards.
Coding the bot: Coding the bot was a struggle, first because we didn't fully understand how the code translated into the physical sensors, but then after that the locations of the sensors disallowed from multiple of them to work as intended at once. In the end, we used an ultrasonic distance sensor instead of bumpers to locate obstacles, both because it is cleaner, and also because they were on opposite sides of the robot, disallowing from both working at once.
Another struggle when coding was figuring out how to follow a line. After much trial and error of different strategies, we ended on a strategy where the robot goes forward a little and then turns left whenever it sees black, and whenever it sees white it scans first about 90 degrees to the right and then to the left as far as it needs before it finds the line again. This allows the robot to go along the line, and anytime it gets off it can scan around to find it again.
Last we used the ultrasonic sensor to detect objects in front of it. If it detects an object the robot will go around it on a set path, and then rejoin the line on the other side.
Results: In the end our robot did manage to navigate our course including many tight turns, following a line, detecting and avoiding obstacles, and moving at a reasonable pace. One flaw is that it does turn left quite slowly as it first checks for the line on the right, but this is an issue we could have fixed had we had more than one sensor as shown with our Redbot.