This is the map that we are going to have the robot follow.
Click here to see an animation of our algorithm in action.
Basic Algorithm
Each of the each points has a list of other road points that it is connected to. The Map class determines the best path from the start to the end road
point using breadth first searcher. The Map will then use some of the code from last year's team to convert this path into directions. These directions will then be used
by the robot to traverse the map.
When you come to an intersection:
- Turn around 180 degrees counter-clockwise to look at the parent node (which direction the robot came from).
- Look at the array of children at the current node and label the parent as spoke 0.
- Continue to turn clockwise, and at each spoke look at the next child in the array (wrapping around to the beginning when the end of the array is reached).
- When the next node in the directions is found, take that spoke and continue on with the map.
- All the spokes to be taken are stored in an integer array which is then sent to the multiple intersection chooser.
Online Code Documentation
Source Code: