From f9b00bd558730a23b5021b4a30c9c1396bf0129a Mon Sep 17 00:00:00 2001 From: robotics1 Date: Mon, 20 Jan 2025 09:00:55 -0800 Subject: [PATCH] Fine tuning to autonomous prior to switching to new robot --- .../ftc/teamcode/ComeBotDriveDevV2.java | 47 +++++++++++++------ .../ftc/teamcode/PedroConstants.java | 2 +- .../cometbots/CometBotTeleopCompetition.java | 14 +++--- .../cometbots/tests/LiftWristArmTest.java | 6 ++- 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ComeBotDriveDevV2.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ComeBotDriveDevV2.java index 6f66db0..94f2d7e 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ComeBotDriveDevV2.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ComeBotDriveDevV2.java @@ -1,5 +1,7 @@ package org.firstinspires.ftc.teamcode; +import static com.qualcomm.hardware.lynx.commands.core.LynxSetMotorPIDFControlLoopCoefficientsCommand.InternalMotorControlAlgorithm.Max; + import androidx.annotation.NonNull; import com.acmerobotics.dashboard.telemetry.TelemetryPacket; @@ -103,7 +105,7 @@ public class ComeBotDriveDevV2 extends OpMode { theArmThingAgain(); break; case 10: - //line six + //moveToParkPath6(); break; case 11: @@ -148,7 +150,7 @@ public class ComeBotDriveDevV2 extends OpMode { } private void doArmThing() { - comp.highBucketDrop(); + comp.highBucketDropAuto(); state = 2; } @@ -157,7 +159,7 @@ public class ComeBotDriveDevV2 extends OpMode { telemetry.addData("end?", follower.atParametricEnd()); if (follower.atParametricEnd()){ follower.breakFollowing(); - comp.highBucketDrop(); + comp.highBucketDropAuto(); state = 6; } // follower.breakFollowing(); @@ -165,7 +167,7 @@ public class ComeBotDriveDevV2 extends OpMode { private void theArmThingAgain() { follower.breakFollowing(); - comp.highBucketDrop(); + comp.highBucketDropAuto(); state = 10; } @@ -231,38 +233,55 @@ public class ComeBotDriveDevV2 extends OpMode { } if (runtime != null) { telemetry.addData("Runtime (seconds)", runtime.seconds()); - if (follower.atParametricEnd() || runtime.seconds() > 12.0) { + if (follower.atParametricEnd() || runtime.seconds() > 10.0) { state = 5; followingPath = false; } } } - private void thePickUp() { + private void thePickUpAuto() { Actions.runBlocking(new SequentialAction( - new SleepAction(.25), + new SleepAction(.1), + comp.claw.openClaw(), + new SleepAction(.2), + comp.wrist.toPickupPosition(), + new SleepAction(.2), comp.arm.toSubmarinePosition(), new SleepAction(.5), - comp.wrist.toPickupPosition(), - new SleepAction(.75), comp.claw.closeClaw(), - new SleepAction(.75), + new SleepAction(.3), comp.wrist.toFloorPosition(), - new SleepAction(0.5), + new SleepAction(.2), comp.arm.toParkPosition(), - new SleepAction(.25) + new SleepAction(.2) + )); + } + private void thePickUp() { + Actions.runBlocking(new SequentialAction( + new SleepAction(.5), + comp.wrist.toPickupPosition(), + new SleepAction(.5), + comp.arm.toSubmarinePosition(), + new SleepAction(.7), + comp.claw.closeClaw(), + new SleepAction(.7), + comp.wrist.toFloorPosition(), + new SleepAction(.5), + comp.arm.toParkPosition(), + new SleepAction(.5) )); } private void doPickUpThing() { follower.breakFollowing(); - thePickUp(); + thePickUpAuto(); state = 4; } private void doPickUpThingAgain() { follower.breakFollowing(); - thePickUp(); + thePickUpAuto(); state = 8; } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PedroConstants.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PedroConstants.java index 85c61e5..ffacbfb 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PedroConstants.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PedroConstants.java @@ -31,7 +31,7 @@ public class PedroConstants { /* Motor Max Power */ - public static final double MAX_POWER = .675; + public static final double MAX_POWER = .8; /* IMU diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/cometbots/CometBotTeleopCompetition.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/cometbots/CometBotTeleopCompetition.java index 10b2658..d1aee5b 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/cometbots/CometBotTeleopCompetition.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/cometbots/CometBotTeleopCompetition.java @@ -212,20 +212,20 @@ public class CometBotTeleopCompetition { } public void highBucketDropAuto() { Actions.runBlocking(new SequentialAction( - new SleepAction(.5), + new SleepAction(.1), this.lift.toHighBucketPosition(), - new SleepAction(.5), + new SleepAction(.25), this.arm.toBucketPosition(), - new SleepAction(.5), + new SleepAction(.25), this.wrist.toBucketPosition(), - new SleepAction(.5), + new SleepAction(.25), this.claw.openClaw(), - new SleepAction(.5), + new SleepAction(.25), this.wrist.toFloorPosition(), - new SleepAction(.5), + new SleepAction(.25), this.arm.toParkPosition(), this.lift.toZeroPosition(), - new SleepAction(.5) + new SleepAction(.25) )); } /* diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/cometbots/tests/LiftWristArmTest.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/cometbots/tests/LiftWristArmTest.java index da35a48..9a68d1c 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/cometbots/tests/LiftWristArmTest.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/cometbots/tests/LiftWristArmTest.java @@ -115,11 +115,13 @@ public class LiftWristArmTest extends LinearOpMode { } if (currentGamepad1.right_bumper && !previousGamepad1.right_bumper) { - lift.setPosition(lift.getPosition() + 175); + lift.setPosition(lift.getPosition() + 100); } if (currentGamepad1.left_bumper && !previousGamepad1.left_bumper) { - lift.setPosition(lift.getPosition() - 25); + if (lift.getPosition() > 1000) { + lift.setPosition(lift.getPosition()-1000); + } }