diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/bob/Bob.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/bob/Bob.java index a5af667d0587..b1a3e40d0a84 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/bob/Bob.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/bob/Bob.java @@ -3,6 +3,7 @@ import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.eventloop.opmode.OpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; +import com.qualcomm.robotcore.hardware.CRServo; import com.qualcomm.robotcore.hardware.DcMotor; import com.qualcomm.robotcore.hardware.Servo; @@ -10,31 +11,18 @@ @SuppressWarnings({"unused"}) public class Bob extends OpMode { - private DcMotor driveRF, driveRB, driveLF, driveLB, liftRight, liftLeft, intakeLeft, intakeRight; - private Servo dropIntake; + private DcMotor driveR, driveL; + private CRServo carousel; @Override public void init() { - driveRF = hardwareMap.get(DcMotor.class, "driveRF"); - driveRB = hardwareMap.get(DcMotor.class, "driveRB"); - driveLF = hardwareMap.get(DcMotor.class, "driveLF"); - driveLB = hardwareMap.get(DcMotor.class, "driveLB"); - liftRight = hardwareMap.get(DcMotor.class, "liftRight"); - liftLeft = hardwareMap.get(DcMotor.class, "liftLeft"); - intakeLeft = hardwareMap.get(DcMotor.class, "intakeLeft"); - intakeRight = hardwareMap.get(DcMotor.class, "intakeRight"); - dropIntake = hardwareMap.get(Servo.class, "dropIntake"); + driveR = hardwareMap.get(DcMotor.class, "driveR"); + driveL = hardwareMap.get(DcMotor.class, "driveL"); + carousel = hardwareMap.get(CRServo.class, "carousel"); - driveRF.setDirection(DcMotor.Direction.FORWARD); - driveRB.setDirection(DcMotor.Direction.FORWARD); - driveLF.setDirection(DcMotor.Direction.REVERSE); - driveLB.setDirection(DcMotor.Direction.REVERSE); - liftRight.setDirection(DcMotor.Direction.FORWARD); - liftLeft.setDirection(DcMotor.Direction.FORWARD); - intakeLeft.setDirection(DcMotor.Direction.FORWARD); - intakeRight.setDirection(DcMotor.Direction.FORWARD); - dropIntake.setDirection(Servo.Direction.FORWARD); + driveR.setDirection(DcMotor.Direction.FORWARD); + driveL.setDirection(DcMotor.Direction.FORWARD); telemetry.addData("Status", "Initialized"); telemetry.update(); @@ -42,60 +30,21 @@ public void init() public void loop() { - //power values for drive train - double xPow, yPow, rxPow; - xPow = gamepad1.left_stick_x; - yPow = gamepad1.left_stick_y; - rxPow = gamepad1.right_stick_x; - //power to drive train (mecanum wheel movement) - driveRF.setPower(yPow - xPow - rxPow); - driveRB.setPower(yPow + xPow - rxPow); - driveLF.setPower(yPow + xPow + rxPow); - driveLB.setPower(yPow - xPow + rxPow); + driveL.setPower(-gamepad1.left_stick_y); + driveR.setPower(gamepad1.right_stick_y); - //servo to rotate intake up and down - if(gamepad1.a) //up + if (gamepad1.right_bumper) //clockwise { - dropIntake.setPosition(0.2); + carousel.setPower(1.0); } - else if (gamepad1.b) //down + else if (gamepad1.left_bumper) //counter-clockwise { - dropIntake.setPosition(0.7); + carousel.setPower(-1.0); } - - //power linear slide to raise and lower intake - if (gamepad1.right_trigger > 0) //expand linear slides - { - liftRight.setPower(gamepad1.right_trigger/2); - liftLeft.setPower(gamepad1.right_trigger/2); - } - else if (gamepad1.left_trigger > 0) //contract linear slides - { - liftRight.setPower(-gamepad1.left_trigger/2); - liftLeft.setPower(-gamepad1.left_trigger/2); - } - else //supply no power to motors - { - liftRight.setPower(0.2); - liftRight.setPower(0.2); - } - - //power intake mechanism to grab and release cargo - if (gamepad1.right_bumper) //take in cargo - { - intakeLeft.setPower(1.0); - intakeRight.setPower(-1.0); - } - else if (gamepad1.left_bumper) //release cargo - { - intakeLeft.setPower(-1.0); - intakeRight.setPower(1.0); - } - else //supply no power to motor + else //turn off power { - intakeLeft.setPower(0.0); - intakeRight.setPower(0.0); + carousel.setPower(0.0); } } } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/CameraTest.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/CameraTest.java similarity index 93% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/CameraTest.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/CameraTest.java index 897da1b48f97..aae54beb03bb 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/CameraTest.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/CameraTest.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.camera; import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.eventloop.opmode.OpMode; @@ -9,7 +9,6 @@ import org.openftc.easyopencv.OpenCvCamera; import org.openftc.easyopencv.OpenCvCameraFactory; import org.openftc.easyopencv.OpenCvCameraRotation; -import org.openftc.easyopencv.OpenCvInternalCamera; @Disabled @TeleOp diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/NerdsPipeline.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/NerdsPipeline.java similarity index 94% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/NerdsPipeline.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/NerdsPipeline.java index 8ec8a52eae2a..efa90772e04d 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/NerdsPipeline.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/NerdsPipeline.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.camera; import org.opencv.core.Mat; import org.opencv.core.Scalar; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RingDetector.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/RingDetector.java similarity index 98% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RingDetector.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/RingDetector.java index 2d5fb8a3d824..8b772e4321c8 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RingDetector.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/RingDetector.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.camera; import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.hardware.HardwareMap; @@ -12,7 +12,6 @@ import org.opencv.imgproc.Imgproc; import org.openftc.easyopencv.OpenCvCamera; import org.openftc.easyopencv.OpenCvCameraFactory; -import org.openftc.easyopencv.OpenCvCameraRotation; import org.openftc.easyopencv.OpenCvInternalCamera; import org.openftc.easyopencv.OpenCvPipeline; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TestCamera.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/TestCamera.java similarity index 95% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TestCamera.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/TestCamera.java index ad731c4891c6..e1d9f101e520 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TestCamera.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/camera/TestCamera.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.camera; import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy/AUTO_Shirley_Blue_LEGACY.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy1/AUTO_Shirley_Blue_LEGACY.java similarity index 98% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy/AUTO_Shirley_Blue_LEGACY.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy1/AUTO_Shirley_Blue_LEGACY.java index 3c79d2e9e20b..79074c15f31b 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy/AUTO_Shirley_Blue_LEGACY.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy1/AUTO_Shirley_Blue_LEGACY.java @@ -1,5 +1,5 @@ //Meet #1 @ Legacy HS 11/20/2021 -package org.firstinspires.ftc.teamcode.legacy; +package org.firstinspires.ftc.teamcode.legacy1; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.Disabled; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy/AUTO_Shirley_Red_LEGACY.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy1/AUTO_Shirley_Red_LEGACY.java similarity index 98% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy/AUTO_Shirley_Red_LEGACY.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy1/AUTO_Shirley_Red_LEGACY.java index d5901c7d0ddf..045a9cb49e8b 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy/AUTO_Shirley_Red_LEGACY.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/legacy1/AUTO_Shirley_Red_LEGACY.java @@ -1,5 +1,5 @@ //Meet #1 @ Legacy HS 11/20/2021 -package org.firstinspires.ftc.teamcode.legacy; +package org.firstinspires.ftc.teamcode.legacy1; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.Disabled; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Blue_Storage_Mojave.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Blue_Storage_Mojave.java similarity index 98% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Blue_Storage_Mojave.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Blue_Storage_Mojave.java index a7a4f6ecdf46..be81dae4bf65 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Blue_Storage_Mojave.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Blue_Storage_Mojave.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.mojave; +package org.firstinspires.ftc.teamcode.mojave3; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.Disabled; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Blue_Warehouse_Mojave.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Blue_Warehouse_Mojave.java similarity index 97% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Blue_Warehouse_Mojave.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Blue_Warehouse_Mojave.java index d6e63eac90ec..07aab59cefe9 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Blue_Warehouse_Mojave.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Blue_Warehouse_Mojave.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.mojave; +package org.firstinspires.ftc.teamcode.mojave3; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.Disabled; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Red_Storage_Mojave.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Red_Storage_Mojave.java similarity index 98% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Red_Storage_Mojave.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Red_Storage_Mojave.java index e0ff44dea6f6..63096b1bc28d 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Red_Storage_Mojave.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Red_Storage_Mojave.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.mojave; +package org.firstinspires.ftc.teamcode.mojave3; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.Disabled; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Red_Warehouse_Mojave.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Red_Warehouse_Mojave.java similarity index 97% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Red_Warehouse_Mojave.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Red_Warehouse_Mojave.java index 7c0548383313..390a32819a55 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Red_Warehouse_Mojave.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/mojave3/AUTO_Shirley_Red_Warehouse_Mojave.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.mojave; +package org.firstinspires.ftc.teamcode.mojave3; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.Disabled; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Blue1.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Blue1.java index 91de00d9549d..2d787ed2b0af 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Blue1.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Blue1.java @@ -8,6 +8,7 @@ import com.qualcomm.robotcore.hardware.Servo; import com.qualcomm.robotcore.util.ElapsedTime; +@Disabled @Autonomous(name = "Shirley Blue Storage Unit BASE") @SuppressWarnings({"unused"}) public class AUTO_Shirley_Blue1 extends LinearOpMode @@ -116,7 +117,7 @@ public void runOpMode() throws InterruptedException frontDrive.setPower(1.0); backDrive.setPower(0.5); runtime.reset(); - while(opModeIsActive() && runtime.seconds() < 0.75)//previously 0.6 + while(opModeIsActive() && runtime.seconds() < 0.85)//previously 0.6, 0.75 { telemetry.update(); } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Blue2.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Blue2.java index 48b38de20b84..bcb225e17341 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Blue2.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Blue2.java @@ -8,7 +8,8 @@ import com.qualcomm.robotcore.hardware.Servo; import com.qualcomm.robotcore.util.ElapsedTime; -@Autonomous(name = "Shirley Blue Warehouse") +@Disabled +@Autonomous(name = "Shirley Blue Warehouse BASE") @SuppressWarnings({"unused"}) public class AUTO_Shirley_Blue2 extends LinearOpMode { @@ -32,6 +33,10 @@ public void runOpMode() throws InterruptedException telemetry.addData("Status", "Initialized"); telemetry.update(); + //initialize claw + rotateClaw.setPosition(0.75); + claw.setPosition(1.0); + waitForStart(); //turn towards warehouse diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Red1.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Red1.java index 4bbf3bcd91e9..5363b7f7a6a3 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Red1.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Red1.java @@ -8,6 +8,7 @@ import com.qualcomm.robotcore.hardware.Servo; import com.qualcomm.robotcore.util.ElapsedTime; +@Disabled @Autonomous(name = "Shirley Red Storage Unit BASE") @SuppressWarnings({"unused"}) public class AUTO_Shirley_Red1 extends LinearOpMode diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Red2.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Red2.java index 71c03a7dd0a9..ef713fe763e2 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Red2.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/AUTO_Shirley_Red2.java @@ -8,7 +8,8 @@ import com.qualcomm.robotcore.hardware.Servo; import com.qualcomm.robotcore.util.ElapsedTime; -@Autonomous(name = "Shirley Red Warehouse") +@Disabled +@Autonomous(name = "Shirley Red Warehouse BASE") @SuppressWarnings({"unused"}) public class AUTO_Shirley_Red2 extends LinearOpMode { diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/EncoderShirley.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/EncoderShirley.java index bd207ed18fbc..36172ea82de0 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/EncoderShirley.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/EncoderShirley.java @@ -1,6 +1,7 @@ package org.firstinspires.ftc.teamcode.shirley; import com.qualcomm.hardware.rev.RevColorSensorV3; +import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.eventloop.opmode.OpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import com.qualcomm.robotcore.hardware.CRServo; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/Shirley.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/Shirley.java index 11d741c3cb14..e3098c3e4bb9 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/Shirley.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/Shirley.java @@ -1,6 +1,7 @@ package org.firstinspires.ftc.teamcode.shirley; import com.qualcomm.hardware.rev.RevColorSensorV3; +import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.eventloop.opmode.OpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import com.qualcomm.robotcore.hardware.CRServo; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/ShirleyBob.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/ShirleyBob.java new file mode 100644 index 000000000000..7505cc6a19f4 --- /dev/null +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/shirley/ShirleyBob.java @@ -0,0 +1,6 @@ +package org.firstinspires.ftc.teamcode.shirley; + +public class ShirleyBob +{ + +}