This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package procedure; | |
import model.Color; | |
import model.Direction; | |
import model.DrawRequest; | |
import model.DrawType; | |
import model.Position; | |
import model.RobotActivity; | |
import model.RobotState; | |
import model.Rotation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void createQueue() { | |
queue = new ArrayDeque<When<Predicate<RobotState>,Fn>>(); | |
queue.push(when(isOnWhiteLine,driveLongBackward)); //if already on white line move backward | |
queue.push(when( and(isIdle, not(isOnWhiteLine)), driveForward)); //start driving forward | |
queue.push(when( and(isMoving, isOnWhiteLine), stopRobot)); //stop when white line is detected | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 2 3 | |
0 0 0 | |
0 0 0 | |
Rotate left | |
2 3 0 | |
1 0 0 | |
0 0 0 |
NewerOlder