Overall Code Design
The software design breaks into two major components: the command module and the service module. The command module will generate the desired command to the service module and the service module will response to the command. There are four major services: the shoot service, the reload service, the SPI service and the motor driving service. The shoot service will launch the ball; the reload service will trigger the resupply station; the SPI service will communicate with FAC and the motor driving service will drive the left and right motor correspondingly.
State diagram
The state chart for the software design is listed below.
state_chart.pdf | |
File Size: | 410 kb |
File Type: |
Pseudo code
All pseudo code we used for software is included in this section
|
|
Header and code listings
Command Module
Command Module will collect information from FAC and send corresponding command to different module
Command Module will collect information from FAC and send corresponding command to different module
PDF Source file
PDF Header files
|
Original code
|
Motor Module
Motor Module will receive the command from command module, like to move forward or to rotate clockwise, and it will translate the high-level command to the corresponding motor behavior. It will also initialize all the driving motors.
Motor Module will receive the command from command module, like to move forward or to rotate clockwise, and it will translate the high-level command to the corresponding motor behavior. It will also initialize all the driving motors.
PDF Source file
PDF Header file
|
Original code
|
Shooting Module
Shooting Module will receive the shoot command from command module and activate the servo to kick the ball to launcher. It will also initialize the launcher to the needed speed.
Shooting Module will receive the shoot command from command module and activate the servo to kick the ball to launcher. It will also initialize the launcher to the needed speed.
PDF Source File
PDF Header File
|
Original code
|
Reload Module
Reload Module will receive signal from command module and emit the corresponding IR signal the trigger the resupply station
Reload Module will receive signal from command module and emit the corresponding IR signal the trigger the resupply station
PDF Source file
PDF Header file
|
Original Code
|
FAC Module
FAC module will communicate with the other part of FAC provided by the teaching team via SPI. It will receive the command from command module and update the requested bot/ship position.
FAC module will communicate with the other part of FAC provided by the teaching team via SPI. It will receive the command from command module and update the requested bot/ship position.
PDF Source file
PDF Header file
|
Original Code
|
Master TImer
Master Timer will follow the whole game, and shut the bot off while it expires.
Master Timer will follow the whole game, and shut the bot off while it expires.
PDF Source file
PDF Header file
|
Original Code
|
ES_Configure
es_configure.pdf | |
File Size: | 27 kb |
File Type: |