Robot Orientation
Introduction
This section describes how Unnatural Born Citizens oriented itself when left in the 18" by 18" squares at the edges of the arena. The details of how the circuits are organized are given in their respective sections. This section only gives their integration method, code with comments and the state machine.
Integration & Strategy
Performing the integration was fairly straightforward as it just connecting the two states as part of the state machine. As far as the hardware was concerned, they were fairly straightforward as they had no hardware integration. The power supply for the bumper circuit was only taken from the beacon as they were both on the upper level of the robot, and the power supply for the beacon sensing was regulated through a voltage regulator.
The major part of the integration was to develop strategy to know which side of the board the robot was started on. This brought in the need for making the different events in the case of which bumper was hit and/or which of the tape sensors crossed the line first. To maintain simplicity, the robot was asked to spin first while it looked for the 5 kHz beacon and then once it had found it, it started to proceed forward towards the beacon and dealing with any events that might occur while moving towards the beacon. Once the robot found the line, it oriented itself such that the rear was facing the SuperPAC and we then asked it to line follow till the rear bumper hit the SuperPAC.
The major part of the integration was to develop strategy to know which side of the board the robot was started on. This brought in the need for making the different events in the case of which bumper was hit and/or which of the tape sensors crossed the line first. To maintain simplicity, the robot was asked to spin first while it looked for the 5 kHz beacon and then once it had found it, it started to proceed forward towards the beacon and dealing with any events that might occur while moving towards the beacon. Once the robot found the line, it oriented itself such that the rear was facing the SuperPAC and we then asked it to line follow till the rear bumper hit the SuperPAC.
State Machine
The implementation of the code was done to create a state machine that accounted for all the possible events and actions that the robot could perform or encounter while attempting to orient the bot. The figure below shows the state machine that was implemented to do the robot orientation.
Code
This Appendix gives the coded state machine as it was implemented in the Arduino environment.