Algorithm:
main(){
1. Calibrate the servo arm, and the initial location of the robot
2. Wait for start light
3. Drive to lever down function
4. Align to the levers function
5. Flip lever function
main(){
1. Calibrate the servo arm, and the initial location of the robot
2. Wait for start light
3. Drive to lever down function
4. Align to the levers function
5. Flip lever function
6. Wait five seconds
7. Flip lever up function
7. Flip lever up function
8. Drive to luggage station and drop off luggage.
9. Drive to ticket station light function
10. Determine what light is shown function
11. Align with ticket station button function
12. Press ticket station button function
13. Drive to passport station function
14. Align with the stamp lever function.
15. Flip the stamp lever function
16. Drive and run into final button function
}
9. Drive to ticket station light function
10. Determine what light is shown function
11. Align with ticket station button function
12. Press ticket station button function
13. Drive to passport station function
14. Align with the stamp lever function.
15. Flip the stamp lever function
16. Drive and run into final button function
}
The logic for the main function is pretty straight forward. We plan on having functions for completing each part of the course. Some attributes of each function will be the same, or very similar, to others. An example of this would be following a line to a certain point, or using the servo arm to flip the levers and the passport stamp. There will be smaller functions within the functions above that will be called for simple things like driving forward, backward, or making turns. Having the main tasks all split into functions will make the code more organized and easier to read and work with.