Software
The software for this project is broken down into one Master State Machine and several services and component control files.
The core state machine (Master State Machine) runs the game state machine, which runs through the rounds of the game as the JSR reports round events to the master. The game state machine runs driving/shooting and jousting state machines concurrently during rounds and driving state machines during recess.
The JSR Service controls SPI communications, requesting both game status and score information. When the JSR receives new game information, it posts it to the Master State Machine.
Component Control:
The core state machine (Master State Machine) runs the game state machine, which runs through the rounds of the game as the JSR reports round events to the master. The game state machine runs driving/shooting and jousting state machines concurrently during rounds and driving state machines during recess.
The JSR Service controls SPI communications, requesting both game status and score information. When the JSR receives new game information, it posts it to the Master State Machine.
Component Control:
- Drive Motor Control - Controls the drive motors and implements a PD control law
- Servo Control - Controls the position of both jousting servos and the launcher gate servo
- Ultrasonic Control - Reports the distance to the front and back wall
- Launcher Control - Turns the launcher motor on and off
- Reload Control - Turns the reload circuit on and off
- Limit Switches - Reports front and back bumper events