Created
November 22, 2012 15:02
-
-
Save tgoossens/4131595 to your computer and use it in GitHub Desktop.
mazeexplore quick fix
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
* Drives the robot in the requested direction. As always the direction is in the relative axis of the robot, | |
* instead of the absolute one. | |
* @param reqDir | |
*/ | |
private void driveSectorLengthInDirection(Orientation reqDir) { | |
if(reqDir == currentOrientation.turnClockWise()){ | |
getRobot().rotate(90, Rotation.CLOCKWISE); | |
}else if(reqDir == currentOrientation.turnAntiClockWise()){ | |
getRobot().rotate(90, Rotation.COUNTERCLOCKWISE); | |
}else if(reqDir == currentOrientation.opposite() ) { | |
getRobot().rotate(180,Rotation.CLOCKWISE); | |
} | |
currentOrientation = reqDir; | |
RobotActivity a = ((Robot) getRobot()).getPilotProvider().active().getRobotActivity(); | |
while(a != RobotActivity.IDLE){ | |
a = ((Robot) getRobot()).getPilotProvider().active().getRobotActivity(); | |
} | |
getRobot().drive(sectorLength, Direction.FORWARD); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment