Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinencounter committed Jan 18, 2025
1 parent 8f50ea6 commit ceb3bd1
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private void hardwareInit() {
// we don't have the proxy object to handle this for us
// so manually implement the inversion
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1 - Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1.05 - Hardware.RIGHT_SLIDE_IN);

hardware.lightLeft.setPosition(Hardware.LAMP_PURPLE);
hardware.lightRight.setPosition(Hardware.LAMP_PURPLE);
Expand Down Expand Up @@ -152,7 +152,7 @@ public void SlideOut() {
hardware.clawFront.setPosition(Hardware.FRONT_OPEN);
sleep(500);
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_OUT);
hardware.horizontalLeft.setPosition(1 - Hardware.RIGHT_SLIDE_OUT);
hardware.horizontalLeft.setPosition(1.05 - Hardware.RIGHT_SLIDE_OUT);
sleep(500);
hardware.clawFlip.setPosition(Hardware.FLIP_DOWN);

Expand All @@ -164,10 +164,10 @@ public void SlideIn() {
hardware.clawFlip.setPosition(Hardware.FLIP_ONE_THIRD);
sleep(500);
hardware.horizontalSlide.setPosition(Hardware.SLIDE_OVERSHOOT);
hardware.horizontalLeft.setPosition(1 - Hardware.SLIDE_OVERSHOOT);
hardware.horizontalLeft.setPosition(1.05 - Hardware.SLIDE_OVERSHOOT);
sleep(500);
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1 - Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1.05 - Hardware.RIGHT_SLIDE_IN);
hardware.clawFlip.setPosition(Hardware.FLIP_UP);
}

Expand All @@ -180,7 +180,7 @@ public void FourthSample() {
hardware.clawTwist.setPosition(0.26);
sleep(500);
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_OUT);
hardware.horizontalLeft.setPosition(1 - Hardware.RIGHT_SLIDE_OUT);
hardware.horizontalLeft.setPosition(1.05 - Hardware.RIGHT_SLIDE_OUT);
sleep(500);
hardware.clawFlip.setPosition(Hardware.FLIP_DOWN);
sleep(500);
Expand All @@ -189,10 +189,10 @@ public void FourthSample() {
hardware.clawTwist.setPosition(Hardware.CLAW_TWIST_INIT);
sleep(500);
hardware.horizontalSlide.setPosition(Hardware.SLIDE_OVERSHOOT);
hardware.horizontalLeft.setPosition(1 - Hardware.SLIDE_OVERSHOOT);
hardware.horizontalLeft.setPosition(1.05 - Hardware.SLIDE_OVERSHOOT);
sleep(500);
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1 - Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1.05 - Hardware.RIGHT_SLIDE_IN);
sleep(500);
hardware.clawFlip.setPosition(Hardware.FLIP_UP);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
public class Hardware extends HardwareMapper implements TriOdoProvider {
public static final int ARM_TRANSFER_POS = -40;
public static final double spinTickPerRev = 751.8;
public static final double RIGHT_SLIDE_OUT = 0.64;
@Deprecated public static final double LEFT_SLIDE_OUT = 1 - RIGHT_SLIDE_OUT;
public static final double RIGHT_SLIDE_IN = 0.375;
@Deprecated public static final double LEFT_SLIDE_IN = 1 - RIGHT_SLIDE_IN;
public static final double RIGHT_SLIDE_OUT = 0.69;
@Deprecated public static final double LEFT_SLIDE_OUT = 1.05 - RIGHT_SLIDE_OUT;
public static final double RIGHT_SLIDE_IN = 0.38;
@Deprecated public static final double LEFT_SLIDE_IN = 1.05 - RIGHT_SLIDE_IN;
public static final double CLAW_TWIST_INIT = 0.48;
public static final double SLIDE_INWARD_TIME = 0.75; // seconds
public static final double SLIDE_OUTWARD_TIME = 0.45; // seconds
public static final double SLIDE_OVERSHOOT = 0.2;
public static final double SLIDE_OVERSHOOT = 0.28;
public static final double FLIP_DOWN = 0.00;
public static final double FRONT_OPEN = 0.25;
public static final double FRONT_CLOSE = 0.07;
Expand Down
43 changes: 22 additions & 21 deletions TeamCode/src/main/java/org/firstinspires/ftc/teamcode/LeftAuto.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,40 +109,41 @@ private ITask pickUpYellow() {
.then(await(500))
.then(hClawProxy.aSetClaw(Hardware.FRONT_CLOSE))
.then(await(250))
.then(hClawProxy.aSetFlip(flipThird))
.then(hClawProxy.aSetFlip(flipThird)));
result
.then(hSlideProxy.moveIn())
.then(hClawProxy.aSetFlip(Hardware.FLIP_UP)));
result.then(transfer());
.then(hClawProxy.aSetFlip(Hardware.FLIP_UP))
.then(transfer());
return result;
}

/* Add Ryan's fourthSample() from FixStuffTeleOp.java here */
private ITask fourthYellow() {
ITask result = groupOf(inner -> inner.add(hClawProxy.aSetFlipClaw(0.167, Hardware.FRONT_OPEN))
.then(await(200))
.then(run(() -> hardware.clawTwist.setPosition(0.26)))
.then(await(200))
.then(run(() -> hardware.clawTwist.setPosition(0.26)))
// .then(await(500))
.then(hSlideProxy.moveOut())
.then(hClawProxy.aSetFlip(Hardware.FLIP_DOWN))
.then(await(200))
.then(hClawProxy.aSetClaw(Hardware.FRONT_CLOSE))
.then(await(200))
.then(run(() -> hardware.clawTwist.setPosition(Hardware.CLAW_TWIST_INIT)))
.then(await(200))
.then(hSlideProxy.moveIn())
.then(hClawProxy.aSetFlip(Hardware.FLIP_UP))
.then(hSlideProxy.moveOut())
.then(hClawProxy.aSetFlip(Hardware.FLIP_DOWN))
.then(await(200))
.then(hClawProxy.aSetClaw(Hardware.FRONT_CLOSE))
.then(await(200))
.then(run(() -> hardware.clawTwist.setPosition(Hardware.CLAW_TWIST_INIT)))
.then(await(200))
);
result.then(transfer());
result.then(hSlideProxy.moveIn())
.then(hClawProxy.aSetFlip(Hardware.FLIP_UP))
.then(transfer());
return result;
}

private ITask scoreHighBasket() {
return groupOf(inner -> inner.add(groupOf(a -> {
// all of these:
a.add(vLiftProxy.moveTo(Hardware.VLIFT_SCORE_HIGH, 10, 2.0));
a.add(run(() -> hardware.arm.setTargetPosition(222)));
a.add(await(250)); // minimum duration
}))
// all of these:
a.add(vLiftProxy.moveTo(Hardware.VLIFT_SCORE_HIGH, 10, 2.0));
a.add(run(() -> hardware.arm.setTargetPosition(222)));
a.add(await(250)); // minimum duration
}))
.then(run(() -> hardware.wrist.setPosition(0.94)))
.then(await(100))
.then(run(() -> hardware.claw.setPosition(Hardware.CLAW_OPEN)))
Expand Down Expand Up @@ -181,7 +182,7 @@ private void hardwareInit() {
// we don't have the proxy object to handle this for us
// so manually implement the inversion
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1 - Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1.05 - Hardware.RIGHT_SLIDE_IN);

hardware.lightLeft.setPosition(Hardware.LAMP_PURPLE);
hardware.lightRight.setPosition(Hardware.LAMP_PURPLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void hardwareInit() {
// we don't have the proxy object to handle this for us
// so manually implement the inversion
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1 - Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1.05 - Hardware.RIGHT_SLIDE_IN);

hardware.lightLeft.setPosition(Hardware.LAMP_PURPLE);
hardware.lightRight.setPosition(Hardware.LAMP_PURPLE);
Expand Down Expand Up @@ -439,7 +439,7 @@ public void ScoreHighBasket1() {
abandonLock(Locks.ArmAssembly);
abandonLock(vLiftProxy.CONTROL);
scheduler.add(
groupOf(inner -> inner.add(vLiftProxy.moveTo(highBasketTicks, 5, 2.0))
groupOf(inner -> inner.add(vLiftProxy.moveTo(Hardware.VLIFT_SCORE_HIGH, 5, 2.0))
.then(run(() -> hardware.arm.setTargetPosition(222)))
// .then(run(() -> hardware.claw.setPosition(0.02)))
// .then(await(500))
Expand Down Expand Up @@ -638,12 +638,14 @@ private TaskGroup transferInternal() {
.then(await(500))
.then(run(() -> hardware.claw.setPosition(Hardware.CLAW_CLOSE)))
.then(await(250))
.then(hClawProxy.aSetClaw(Hardware.FRONT_OPEN))
.then(run(() -> {
hardware.arm.setTargetPosition(0);
hClawProxy.setClaw(Hardware.FRONT_OPEN);
}))
.then(await(100))
.then(run(() -> hardware.clawFront.setPosition(0.6)))
.then(await(250))
.then(run(() -> {
hardware.arm.setTargetPosition(0);
hardware.wrist.setPosition(Hardware.WRIST_BACK);
}))
).extraDepends(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void hardwareInit() {
// we don't have the proxy object to handle this for us
// so manually implement the inversion
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1 - Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1.05 - Hardware.RIGHT_SLIDE_IN);

hardware.lightLeft.setPosition(Hardware.LAMP_PURPLE);
hardware.lightRight.setPosition(Hardware.LAMP_PURPLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void invokeOnStart() {

public void update() {
hardware.horizontalSlide.setPosition(position);
hardware.horizontalLeft.setPosition(1 - position);
hardware.horizontalLeft.setPosition(1.05 - position);
}

private void moveTo(double newPos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BoxTest : LinearOpMode() {
// we don't have the proxy object to handle this for us
// so manually implement the inversion
hardware.horizontalSlide.position = Hardware.RIGHT_SLIDE_IN;
hardware.horizontalLeft.position = 1 - Hardware.RIGHT_SLIDE_IN;
hardware.horizontalLeft.position = 1.05 - Hardware.RIGHT_SLIDE_IN;

hardware.lightLeft.position = Hardware.LAMP_PURPLE;
hardware.lightRight.position = Hardware.LAMP_PURPLE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void hardwareInit() {
// we don't have the proxy object to handle this for us
// so manually implement the inversion
h.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_IN);
h.horizontalLeft.setPosition(1 - Hardware.RIGHT_SLIDE_IN);
h.horizontalLeft.setPosition(1.05 - Hardware.RIGHT_SLIDE_IN);

h.lightLeft.setPosition(Hardware.LAMP_PURPLE);
h.lightRight.setPosition(Hardware.LAMP_PURPLE);
Expand Down

0 comments on commit ceb3bd1

Please sign in to comment.