Algorithm Two: Intersection Identifier



Note: Sensor's are aligned left-center-right, "0" is equivalent to white, and "1" is equivalent to black.



If 0-0-0 : Robot is lost. Call search function.
If 0-0-1 : Correct by turning right.
If 0-1-0 : Go straight. Note, this is the optimal state.
If 0-1-1 : Determine if at an intersection. If not, go Right.
If 1-0-0 : Correct by turning left.
If 1-0-1 : At a Y intersection.
If 1-1-0 : Determine if at an intersection. If not, go Left.
If 1-1-1 : At a T, a Y, or a + intersection.


If 1-1-1 becomes 0-1-0 : At a four way (+) intersection.
If 1-1-1 becomes 0-0-0 : At a T intersection.
If 1-1-1 becomes 1-0-1 : At a Y intersection.
If 0-1-1 becomes 0-0-0 : Right turn.
If 0-1-1 becomes 0-1-0 : At a |- intersection.
If 1-1-0 becomes 0-0-0 : Left turn.
If 1-1-0 becomes 0-1-0 : At a -| intersection.
If 0-1-1 becomes 1-0-0 : At an inverted Y intersection.
If 1-1-0 becomes 0-0-1 : At an inverted Y intersection.

Go Back To Algorithm Menu | Look at Algorithm One |