diff --git a/TeamCode/src/main/java/opmodes/MainTeleOp.java b/TeamCode/src/main/java/opmodes/MainTeleOp.java index 9eeb5b9..1a4dc11 100644 --- a/TeamCode/src/main/java/opmodes/MainTeleOp.java +++ b/TeamCode/src/main/java/opmodes/MainTeleOp.java @@ -50,7 +50,7 @@ public class MainTeleOp extends OpMode { boolean clawDown = gamepad2.a || clawDownSafe; // A // Robot Drone Launch - boolean robotDroneLaunch = gamepad1.right_bumper; // Change if Merck wants (RT) + boolean robotDroneLaunch = gamepad1.left_bumper; // Change if Merck wants (LT) // Robot Lift boolean robotLiftRotation = gamepad2.right_trigger > 0.05; // RT @@ -121,6 +121,8 @@ public class MainTeleOp extends OpMode { if (robotDroneLaunch) { this.robot.getDrone().raise(); + } else { + this.robot.getDrone().reset(); } // Robot Lift diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/Drone.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/Drone.java index 074995c..22820fd 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/Drone.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/Drone.java @@ -1,6 +1,8 @@ package org.firstinspires.ftc.teamcode.hardware; +import static org.firstinspires.ftc.teamcode.hardware.RobotConfig.DRONE_LAUNCH_POS; import static org.firstinspires.ftc.teamcode.hardware.RobotConfig.DRONE_ROTATION_UP_NAME; +import static org.firstinspires.ftc.teamcode.hardware.RobotConfig.DRONE_STOW_POS; import com.qualcomm.robotcore.hardware.HardwareMap; import com.qualcomm.robotcore.hardware.Servo; @@ -14,7 +16,11 @@ public class Drone { } public void raise() { - this.droneLaunchServo.setPosition(0.2); - + this.droneLaunchServo.setPosition(DRONE_LAUNCH_POS); } + + public void reset() { + this.droneLaunchServo.setPosition(DRONE_STOW_POS); + } + } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/RobotConfig.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/RobotConfig.java index ad51b64..da239fe 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/RobotConfig.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/RobotConfig.java @@ -16,7 +16,7 @@ public class RobotConfig { public static final String GANTRY_X_NAME = "gantry_x"; public static final String GANTRY_ARM_NAME = "gantryArm"; public static final String GANTRY_SCREW_NAME = "screw"; - public static final String DRONE_ROTATION_UP_NAME = "droneUp"; + public static final String DRONE_ROTATION_UP_NAME = "droneLaunch"; public static final String ROBOT_LIFT_ROTATION_NAME = "liftRotation"; public static final String ROBOT_LIFT_LIFT_NAME = "liftLift"; public static final String WEBCAM_NAME = "webcam"; @@ -53,6 +53,8 @@ public class RobotConfig { // Robot Drone Launch public static double DRONE_ROTATION_UP = 0.2; + public static double DRONE_LAUNCH_POS = 0.3; + public static double DRONE_STOW_POS = 0.2; // Robot Lift public static double LIFT_ROTATION_UP = 0.4;