State Machine Descriptions
TopHSM is our master state machine file that controls the stage in game play and receives all incoming logic events. It calls sub state-machines for certain rounds, which modify incoming events where appropriate to indicate to TopHSM that it is time to change stages.
MoveForwardHSM is our sub-state machine that is called for all stages that require movement. It allows the robots to pause in the middle of a stage to shoot or hit a stationary target, and also handles logic to determine end of stage scenarios based on JSR commands and distance traveled.
ReloadHSM is the specialized sub state machine that is called to execute the reloading process. This machine has numerous states that allow the robots to find the black line, align with the black line, move to the reloading station, request 5 balls, and then return to an appropriate position to start stage 3.
JoustingHSM and Shooting HSM
JoustingHSM and ShootingHSM are simple sub state-machines that, in appropriate stages, check for IR signals and, when activated, command the MoveForwardHSM to pause and the shooting/jousting services to activate. When the shooting/lancing motions are completed, these HSMs will then resume the moving process.