Software Design
Master SM State Chart
During our testing/grading sessions, we also included a ShootPowerSM state that searched for the opposing side's power supply IR beacon and fired a ball at the beacon. See Source Files and Pseudo Code for details about each state and sub-state machine.
Sector definition
We split the field into 6 sectors to optimize the order that we targeted enemy ships. The bot would first target ships that are directly in front (Sector 1) and then target the ships that are directly in front but farther in the back of the field (4). The next sector targeted is 2, then 5 (this requires the bot to rotate CW 45 degrees). The final sectors targeted are 3, then 6 (the bot needs to rotate CCW 90 from the sector 2 & 5 position).
Timer Descriptions
Timer 0- FAC Communication Timer, used in FACComm to time 2ms between each transfer
Timer 1- Used for motor drive, especially turning. After it times out, MasterSM will call Stop()
Timer 2- Timer to allow time between aim/fire commands and the actual mechanical movement
Timer 3- Used for uncloaking time, between uncloaking and FAC updating
Timer 4- Used for motor drive forward. After it times out, MasterSM will call Stop()
Timer 5- Used for servo delay time
Timer 6- Used for 360 degree loading servo delay time
Timer 7- Used for game status update, every 100ms before the game starts and 500ms after the game starts
Timer 1- Used for motor drive, especially turning. After it times out, MasterSM will call Stop()
Timer 2- Timer to allow time between aim/fire commands and the actual mechanical movement
Timer 3- Used for uncloaking time, between uncloaking and FAC updating
Timer 4- Used for motor drive forward. After it times out, MasterSM will call Stop()
Timer 5- Used for servo delay time
Timer 6- Used for 360 degree loading servo delay time
Timer 7- Used for game status update, every 100ms before the game starts and 500ms after the game starts