From ceb3bd18f70b6e68b469d8da2962aa5db24ac4d1 Mon Sep 17 00:00:00 2001 From: penguinencounter <49845522+penguinencounter@users.noreply.github.com> Date: Fri, 17 Jan 2025 21:24:24 -0800 Subject: [PATCH] stuff --- .../ftc/teamcode/FixStuffTeleOp.java | 14 +++--- .../firstinspires/ftc/teamcode/Hardware.java | 10 ++--- .../firstinspires/ftc/teamcode/LeftAuto.java | 43 ++++++++++--------- .../ftc/teamcode/MecanumTeleOp2.java | 10 +++-- .../firstinspires/ftc/teamcode/RightAuto.java | 2 +- .../ftc/teamcode/hardware/HSlideProxy.java | 2 +- .../ftc/teamcode/utilities/BoxTest.kt | 2 +- .../teamcode/utilities/VerticalSlideTool.java | 2 +- 8 files changed, 44 insertions(+), 41 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/FixStuffTeleOp.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/FixStuffTeleOp.java index 2bbc7a99715d..72115a26ec01 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/FixStuffTeleOp.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/FixStuffTeleOp.java @@ -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); @@ -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); @@ -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); } @@ -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); @@ -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); } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Hardware.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Hardware.java index 42740c0f4fee..840cc25d064b 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Hardware.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Hardware.java @@ -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; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/LeftAuto.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/LeftAuto.java index 2acccd2f8f8a..abef51be7ef8 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/LeftAuto.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/LeftAuto.java @@ -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))) @@ -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); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MecanumTeleOp2.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MecanumTeleOp2.java index 95d0d373814b..c035c11dfe52 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MecanumTeleOp2.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MecanumTeleOp2.java @@ -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); @@ -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)) @@ -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( diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RightAuto.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RightAuto.java index 8fc52d09d184..b64059d2537f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RightAuto.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RightAuto.java @@ -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); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/HSlideProxy.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/HSlideProxy.java index c37db09494b9..bef45daaf3af 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/HSlideProxy.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/HSlideProxy.java @@ -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) { diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/BoxTest.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/BoxTest.kt index 4c54a594ea10..beb16b32fdfb 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/BoxTest.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/BoxTest.kt @@ -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; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/VerticalSlideTool.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/VerticalSlideTool.java index 97e3d6f7f50f..b10e7b04b129 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/VerticalSlideTool.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/VerticalSlideTool.java @@ -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);