Define the Problem
In the event of a disaster, how can a robot navigate safely out of a building using its sensors?
Goal: the robot has to navigate through a course to the finish using sensors like the color sensor, ultrasonic, and touch sensors.
Generate alternative concepts / Possible Coding Options
Use only the touch sensor to detect walls in front of the robot.
Left-Hand rule, Right-Hand rule, and checking distances on each side using the ultrasonic sensor in order to decide which direction to turn towards.
Use the light sensor to follow a path given to the robot.
Evaluate and select a concept
We believe that using the three concepts stated above together could help the robot navigate a course successfully.
Detail the design
Our design consists of a combination of following a colored path using the light sensor and using the ultrasonic sensor for locomotion based on barriers. To this end, we chose to use the BuggyBot, which had the required sensors and was also compactly sized.
See flowchart on "Course and Source Code" page.
Defend design
Our design makes use of following a line, which represents emergency exit routes in a building. However, it also allows for contingencies should the line be blocked: in this case, it uses its sensors to evaluate its distance in space and move toward the clearest path.
Manufacture and Test
We tested our coding with several runs in ROBOTC, making modifications as we went.
It took several tries to make to robot sense the obstacle at the end of the black-line pathway, but we got it eventually.
See code and course on "Course and Source Code" page.
Evaluate Performance
Our robot was able to perform excellently in the maze we had constructed.
Flowchart Pseudocode and course building:
We started with the fact that to navigate the course, we would need to use sensors and a single robot. We chose to use the BuggyBot and its color and ultrasonic/sonar sensors to help us navigate lines and sense objects that were in the robot's pathway.
While building the course, we decided to add a line for the robot to follow, and ending up adding a dead-end at the end of it to test if the robot could handle a problem occurring, like an object blocking the desired pathway to escape. The ultrasonic sensor of the robot would see the dead end, and the robot would stop trying to follow the line. Instead, it would check the left and right pathways to see which one was open. Then, it would turn to the open direction to escape. The flowchart based on our algorithm and the course we designed is on the "Course and Source Code" page.
Coding:
Because we had thought out our flowchart before we started coding, the process was much easier. We were able to use some code from given sample codes, along with using the internet to help us learn more about specific sensors and their functions. After writing the majority of our code, we gave it a couple test runs and tweaked whatever we had to. We also changed some of the coding bits which we had initially hard coded to incorporate logic and sensor input into the final result.