The code for our robot was written in the Arduino IDE. We had one source file which made function calls to various C header files. These header files contained function declarations and definitions, as well as constants used throughout the program.
Actuators: This header file contained functions to turn the motors used to lower and raise the arm, open and close the pincers, as well as raise and lower the lift.
Constants: All of the constant variables used in our program were stored in this file to be used anywhere in the code.
Menu: The Menu class allowed us to be able to input information to the TINAH board while testing without having to reconnect to a computer. We could decide which stage of the course to run, and we could modify various parameters such as speed or threshold values.
Navigate: Our navigation header was designed to be used for robot movements on the course that did not involve tape following. For example, one of the functions in this file was used to locate the zipline on the competition surface.
Tape: The three main functions in this file were all used for tape following along the surface. We had a separate function for tape following around the tank which allowed us to make corrections to the robot's position when it stopped at a tick mark to pick up an agent.
Our code repository is hosted on Github. Using git simplified the process of collaboration by allowing us both to work simultaneously on separate files or functions without fear of overwriting each other's progress.
To navigate the competition surface Veronica followed black tape with information from two reflectance sensors (QRD1114) mounted underneath the chassis by utilizing PID (Proportional Integral Derivative) control. The tape following code used a PID algorithm to determine and implement motor corrections which kept Veronica driving directly over the tape. Tuning was done experimentally. The final algorithm can be found in the tape.h file located in our github repository.
Veronica tape following by PID control