Code Hierarchy
Below is the general structure of our source files. It generally mimics our state machine hierarchy, with other modules included. Please see further down the page for code and pseudocode listings.
Code and Pseudocode Listings
Pseudocode listings link to a single page for each section. Code listings link to formatted html files containing our source code. All code listed is our own work (libraries that were provided to us, e.g. A/D input, are not listed here).
Main
These files include our event definitions, our main function, our event checker and our debugging utilities.
High-level State Machine
These files include the topmost levels of our state machine, and are mainly used to run concurrent, child state machines.
Pseudocode |
Code Files |
Offensive Coordinator
These files are used to interact with the offensive coordinator. Sending of commands, querying the status of a previous command, and receiving responses from the field are all handled within this module.
Pseudocode |
Code Files |
Gameplay
These files represent the most in depth and appropriate usage of state machines in our code. The Gameplay state machine determines the current objective with respect to our strategy, and the remaining state machines execute more specific tasks.
Sensors
These files handle all input to the robot. The beacon detection module uses interrupts to capture the signal from our beacon detection circuit, and implements debounce and a history of angular position to reliably keep track of the six beacons on the field.
Drivetrain and Servos
These files control all actuation of the robot. The Drivetrain state machine receives a high-level drive command (such as track a beacon) and performs all the required adjustments to achieve its goal.
Pseudocode |
Code Files |