diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TeleOpMain.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TeleOpMain.java index a544162..e9d0819 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TeleOpMain.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TeleOpMain.java @@ -97,10 +97,16 @@ public void runOpMode() { // Allows for driver Control of the sorter // Intake positions for the sorter + // gamepad2.x is intake sorter position 1 + // gamepad2.y is intake sorter position 2 + // gamepad2.b is intake sorter position 3 sorter.simpleSorterPosition(gamepad2.x, gamepad2.y, gamepad2.b, SorterControls.sorterModes.INTAKE); // Launch positons for the sorter + // gamepad2.x is launch sorter position 1 + // gamepad2.y is launch sorter position 2 + // gamepad2.b is launch sorter position 3 sorter.simpleSorterPosition(gamepad2.dpad_left, gamepad2.dpad_up, gamepad2.dpad_right, SorterControls.sorterModes.LAUNCH); @@ -114,10 +120,6 @@ public void runOpMode() { motors.Flipper.setPosition(0.15); } -// if (gamepad1.left_bumper) { -// sorter.moveGreenToLaunchPos(); -// } - intake.setIntakeDirection(gamepad2.left_bumper, gamepad2.right_bumper); //Add option to enable brakes when sharbell holds a drive.setDriveMotorZeroPowerBehavior(gamepad1.b); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Utils_13233/LaunchControls.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Utils_13233/LaunchControls.java index 26fdf19..d8512ba 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Utils_13233/LaunchControls.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Utils_13233/LaunchControls.java @@ -20,8 +20,6 @@ public LaunchControls(HardwareMap hardwareMap) { * * @param launchInput Button mapped to launch input */ - - public void setLaunchPower(boolean launchInput) { double power = launchInput ? 1.0f : 0.0f; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Utils_13233/SorterControls.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Utils_13233/SorterControls.java index 07aaa62..0ffa1ea 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Utils_13233/SorterControls.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Utils_13233/SorterControls.java @@ -17,9 +17,10 @@ public class SorterControls { public int LaunchPos2 = 180; public int LaunchPos3 = 356; + // Create an instance of the sorterPositons enum to track the current position of the sorter public sorterPositions currentSorterPosition; - + // Array of the current sorter states 0 is sorter position one and so on public ballColors[] currentSorterStates = {ballColors.NULL, ballColors.NULL, ballColors.GREEN}; // Motor Speed @@ -130,6 +131,15 @@ public void moveSorterToPos(sorterModes mode, int pos) { } } + /** + * Allows for easier control of sorter positions in teleop allowing for the binding of + * controller buttons to the sorter positions + * + * @param position1Button Button to move to position 1 + * @param position2Button Button to move to position 2 + * @param position3Button Button to move to position 3 + * @param mode the mode of the position either INTAKE or LAUNCH + */ public void simpleSorterPosition(boolean position1Button, boolean position2Button, boolean position3Button, sorterModes mode) { if (position1Button) { @@ -143,7 +153,10 @@ public void simpleSorterPosition(boolean position1Button, boolean position2Butto /** * Sorts through the balls in the sorter and moves a green ball to the launch position - * automatically + * automatically, it does this by iterating through all index positions in currentSorterStates + *
+ * May cause some performance impact due to the use of a for loop however it is simple enough + * that it should be fine and thus far has not caused any issues */ public void moveGreenToLaunchPos() { for (int i = 0; i < currentSorterStates.length; i++) { @@ -156,7 +169,10 @@ public void moveGreenToLaunchPos() { /** * Sorts through the balls in the sorter and moves a purple ball to the launch position - * automatically + * automatically, it does this by iterating through all index positions in currentSorterStates + *
+ * May cause some performance impact due to the use of a for loop however it is simple enough + * that it should be fine and thus far has not caused any issues */ public void moveToPurpleLaunchPos() { for (int i = 0; i < currentSorterStates.length; i++) { @@ -211,6 +227,4 @@ public enum sorterPositions { LAUNCH_POS_2, LAUNCH_POS_3 } - - }