Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

Commit

Permalink
collected ball better
Browse files Browse the repository at this point in the history
  • Loading branch information
Neycrow committed Jun 3, 2022
1 parent 9cd8fcf commit 6ff5982
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 31 deletions.
3 changes: 2 additions & 1 deletion src/team/brickfire/RunWRO.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static void main(String[] args) {
ActionsRoom test = new ActionsRoom(robot);
test.scanBlock(true);
new ActionsLaundry(robot).collectBlock(true);
new ActionsWater(robot).deliver(true);
//new ActionsWater(robot).deliver(true);
test.playGame(true);
}
}
20 changes: 11 additions & 9 deletions src/team/brickfire/actions/ActionsLaundry.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ public ActionsLaundry(Robot robot) {
}

public void collectBlock(boolean forward) {
robot.arm().closeClawTo(-90);
robot.arm().moveArmTo(145);
robot.travel(-8);
robot.scanner().getColorID();
robot.travel(-2);
robot.arm().closeClawTo(-20);
robot.arm().moveArmTo(-110);
robot.arm().closeClawTo(-150);
robot.travel(-10);
if (forward == true) {
robot.travel(-7.95);
robot.arm().closeClawTo(-200);
robot.arm().moveArmTo(135);
robot.scanner().getColorID();
robot.travel(-2);
robot.arm().closeClawTo(-20);
robot.arm().moveArmTo(-110);
robot.arm().closeClawTo(-150);
robot.travel(-10);
} else {}
}

}
34 changes: 19 additions & 15 deletions src/team/brickfire/actions/ActionsRoom.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,28 @@ public ActionsRoom(Robot robot) {
}

public void scanBlock (boolean forward) {
isRoomGame = robot.scanner().isColor(Color.GREEN);
robot.arm().moveArmTo(175);
robot.travel(-2.8);
robot.arm().moveArmTo(-150);
if (forward == true) {
isRoomGame = robot.scanner().isColor(Color.GREEN);
robot.arm().moveArmTo(175);
robot.travel(-2.8);
robot.arm().moveArmTo(-150);
} else {}
}

public void playGame (boolean forward) {
robot.arm().moveArmTo(-200);
robot.travel(-8);
robot.motorLeft().rotate(-100);
robot.arm().closeClawTo(30);
robot.arm().moveArmTo(0);
robot.motorLeft().rotate(-260);
robot.travel(-4.5);
robot.arm().moveArmTo(-350);
robot.motorRight().rotate(-35);
robot.travel(-7.5);
robot.arm().closeClawTo(-260);
if (forward == true) {
robot.arm().moveArmTo(-200);
robot.travel(-8);
robot.motorLeft().rotate(-100);
robot.arm().closeClawTo(-30);
robot.arm().moveArmTo(0);
robot.motorLeft().rotate(-260);
robot.travel(-4.5);
robot.motorRight().rotate(-35);
robot.arm().moveArmTo(-350);
robot.travel(-7.8);
robot.arm().closeClawTo(-260);
} else {}
}
}

Expand Down
17 changes: 11 additions & 6 deletions src/team/brickfire/actions/ActionsWater.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ public void collectBottles() {
}

public void deliver(boolean forward) {
robot.turn(100);
robot.travel(-17);
robot.travel(6.5);
robot.arm().moveArmTo(110);
robot.arm().closeClawTo(0);
robot.arm().moveArmTo(-310);
if (forward == true) {
robot.turn(100);
robot.travel(-17);
robot.travel(6.5);
robot.arm().moveArmTo(110);
robot.arm().closeClawTo(0);
robot.arm().moveArmTo(-310);
} else {}
}

public void skip(boolean forward) {
if (forward == true) {

} else {}

}
}

0 comments on commit 6ff5982

Please sign in to comment.