Compare commits
2 Commits
edc300c1d5
...
1ab0b214c3
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ab0b214c3 | |||
| 5d2a2e1da8 |
@@ -73,6 +73,7 @@ import com.acmerobotics.roadrunner.TranslationalVelConstraint;
|
||||
import com.acmerobotics.roadrunner.Vector2d;
|
||||
import com.acmerobotics.roadrunner.ftc.Actions;
|
||||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
||||
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
|
||||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
||||
|
||||
import org.firstinspires.ftc.teamcode.constants.Poses_V2;
|
||||
@@ -84,6 +85,7 @@ import org.firstinspires.ftc.teamcode.utils.Spindexer;
|
||||
import org.firstinspires.ftc.teamcode.utils.Targeting;
|
||||
import org.firstinspires.ftc.teamcode.utils.Turret;
|
||||
|
||||
@Disabled
|
||||
@Config
|
||||
@Autonomous(preselectTeleOp = "TeleopV3")
|
||||
public class Auto_LT_Close_12Ball extends LinearOpMode {
|
||||
@@ -102,7 +104,7 @@ public class Auto_LT_Close_12Ball extends LinearOpMode {
|
||||
public static double shoot0Time = 1.6;
|
||||
public static double intake1Time = 3.0;
|
||||
public static double flywheel0Time = 3.5;
|
||||
public static double pickup1Speed = 25;
|
||||
public static double pickup1Speed = 17;
|
||||
// ---- SECOND SHOT / PICKUP ----
|
||||
public static double shoot1Vel = 2300;
|
||||
public static double shoot1Hood = 0.93;
|
||||
@@ -720,7 +722,6 @@ public class Auto_LT_Close_12Ball extends LinearOpMode {
|
||||
new TranslationalVelConstraint(pickup1Speed));
|
||||
|
||||
shoot1 = drive.actionBuilder(new Pose2d(x2b, y2b, h2b))
|
||||
.strafeToLinearHeading(new Vector2d(xPrep, yPrep), hPrep)
|
||||
.strafeToLinearHeading(new Vector2d(xShoot, yShoot), hShoot);
|
||||
|
||||
pickup2 = drive.actionBuilder(new Pose2d(xShoot, yShoot, hShoot))
|
||||
@@ -729,7 +730,6 @@ public class Auto_LT_Close_12Ball extends LinearOpMode {
|
||||
new TranslationalVelConstraint(pickup1Speed));
|
||||
|
||||
shoot2 = drive.actionBuilder(new Pose2d(x3b, y3b, h3b))
|
||||
.strafeToLinearHeading(new Vector2d(xPrep, yPrep), hPrep)
|
||||
.strafeToLinearHeading(new Vector2d(xShoot, yShoot), hShoot);
|
||||
|
||||
pickup3 = drive.actionBuilder(new Pose2d(x1, y1, h1))
|
||||
@@ -737,7 +737,6 @@ public class Auto_LT_Close_12Ball extends LinearOpMode {
|
||||
.strafeToLinearHeading(new Vector2d(x4b, y4b), h4b,
|
||||
new TranslationalVelConstraint(pickup1Speed));
|
||||
shoot3 = drive.actionBuilder(new Pose2d(x4b, y4b, h4b))
|
||||
.strafeToLinearHeading(new Vector2d(xPrep, yPrep), hPrep)
|
||||
.strafeToLinearHeading(new Vector2d(xShoot, yShoot), hShoot);
|
||||
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ import java.util.Objects;
|
||||
public class Auto_LT_Close_12Ball_Indexed extends LinearOpMode {
|
||||
public static double shoot0Vel = 2300, shoot0Hood = 0.93;
|
||||
public static double autoSpinStartPos = 0.2;
|
||||
public static double shoot0SpinSpeedIncrease = 0.022;
|
||||
public static double shoot0SpinSpeedIncrease = 0.015;
|
||||
|
||||
public static double spindexerSpeedIncrease = 0.03;
|
||||
|
||||
@@ -106,12 +106,12 @@ public class Auto_LT_Close_12Ball_Indexed extends LinearOpMode {
|
||||
public static double normalIntakeTime = 3.0;
|
||||
public static double shoot1Turr = 0.57;
|
||||
public static double shoot0XTolerance = 1.0;
|
||||
public static double turretShootPos = 0.53;
|
||||
public static double turretShootPos = 0.52;
|
||||
public static double shootAllTime = 1.8;
|
||||
public static double shoot0Time = 1.6;
|
||||
public static double intake1Time = 3.0;
|
||||
public static double flywheel0Time = 3.5;
|
||||
public static double pickup1Speed = 25;
|
||||
public static double pickup1Speed = 19;
|
||||
// ---- SECOND SHOT / PICKUP ----
|
||||
public static double shoot1Vel = 2300;
|
||||
public static double shoot1Hood = 0.93;
|
||||
@@ -128,12 +128,12 @@ public class Auto_LT_Close_12Ball_Indexed extends LinearOpMode {
|
||||
public static double obelisk1YTolerance = 2.0;
|
||||
public static double shoot1ToleranceX = 2.0;
|
||||
public static double shoot1ToleranceY = 2.0;
|
||||
public static double shoot1Time = 2.5;
|
||||
public static double shoot2Time = 2.5;
|
||||
public static double shoot3Time = 2.5;
|
||||
public static double colorSenseTime = 0.8;
|
||||
public static double shoot1Time = 2;
|
||||
public static double shoot2Time = 2;
|
||||
public static double shoot3Time = 2;
|
||||
public static double colorSenseTime = 1.2;
|
||||
|
||||
public static double firstShootTime = 0.5;
|
||||
public static double firstShootTime = 0.3;
|
||||
public int motif = 0;
|
||||
|
||||
Robot robot;
|
||||
@@ -488,8 +488,13 @@ public class Auto_LT_Close_12Ball_Indexed extends LinearOpMode {
|
||||
}
|
||||
|
||||
ticker++;
|
||||
|
||||
robot.limelight.pipelineSwitch(1);
|
||||
motif = turret.detectObelisk();
|
||||
if (redAlliance){
|
||||
robot.limelight.pipelineSwitch(4);
|
||||
} else {
|
||||
robot.limelight.pipelineSwitch(2);
|
||||
}
|
||||
|
||||
robot.turr1.setPosition(turrPos);
|
||||
robot.turr2.setPosition(1 - turrPos);
|
||||
@@ -836,7 +841,6 @@ public class Auto_LT_Close_12Ball_Indexed extends LinearOpMode {
|
||||
new TranslationalVelConstraint(pickup1Speed));
|
||||
|
||||
shoot1 = drive.actionBuilder(new Pose2d(x2b, y2b, h2b))
|
||||
.strafeToLinearHeading(new Vector2d(xPrep, yPrep), hPrep)
|
||||
.strafeToLinearHeading(new Vector2d(xShoot, yShoot), hShoot);
|
||||
|
||||
pickup2 = drive.actionBuilder(new Pose2d(xShoot, yShoot, hShoot))
|
||||
@@ -845,7 +849,6 @@ public class Auto_LT_Close_12Ball_Indexed extends LinearOpMode {
|
||||
new TranslationalVelConstraint(pickup1Speed));
|
||||
|
||||
shoot2 = drive.actionBuilder(new Pose2d(x3b, y3b, h3b))
|
||||
.strafeToLinearHeading(new Vector2d(xPrep, yPrep), hPrep)
|
||||
.strafeToLinearHeading(new Vector2d(xShoot, yShoot), hShoot);
|
||||
|
||||
pickup3 = drive.actionBuilder(new Pose2d(x1, y1, h1))
|
||||
@@ -853,7 +856,6 @@ public class Auto_LT_Close_12Ball_Indexed extends LinearOpMode {
|
||||
.strafeToLinearHeading(new Vector2d(x4b, y4b), h4b,
|
||||
new TranslationalVelConstraint(pickup1Speed));
|
||||
shoot3 = drive.actionBuilder(new Pose2d(x4b, y4b, h4b))
|
||||
.strafeToLinearHeading(new Vector2d(xPrep, yPrep), hPrep)
|
||||
.strafeToLinearHeading(new Vector2d(xShoot, yShoot), hShoot);
|
||||
|
||||
TELE.addData("Red?", redAlliance);
|
||||
|
||||
@@ -7,5 +7,5 @@ public class Color {
|
||||
public static boolean redAlliance = true;
|
||||
public static double Light0 = 0.28, Light1 = 0.67, Light2 = 0.36, Light3 = 0.5;
|
||||
|
||||
public static double colorFilterAlpha = 0.15;
|
||||
public static double colorFilterAlpha = 1;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ public class Poses {
|
||||
public static double rx3a = 55, ry3a = 39, rh3a = Math.toRadians(140);
|
||||
public static double rx3b = 38, ry3b = 56, rh3b = Math.toRadians(140.1);
|
||||
|
||||
public static double rx4a = 72, ry4a = 65, rh4a = Math.toRadians(145);
|
||||
public static double rx4b = 37, ry4b = 85, rh4b = Math.toRadians(145.1);
|
||||
public static double rx4a = 72, ry4a = 50, rh4a = Math.toRadians(145);
|
||||
public static double rx4b = 42, ry4b = 80, rh4b = Math.toRadians(145.1);
|
||||
|
||||
public static double bx1 = 40, by1 = 7, bh1 = 0;
|
||||
public static double bx2a = 45, by2a = -18, bh2a = Math.toRadians(-140);
|
||||
|
||||
@@ -16,10 +16,11 @@ public class ServoPositions {
|
||||
|
||||
public static double spindexer_outtakeBall2 = 0.53; //0.46; //0.6;
|
||||
public static double spindexer_outtakeBall1 = 0.35; //0.27; //0.4;
|
||||
public static double spinStartPos = spindexer_outtakeBall3 - 0.1;
|
||||
public static double spinStartPos = 0.25;
|
||||
public static double spinEndPos = 0.85;
|
||||
|
||||
public static double shootAllAutoSpinStartPos = 0.2;
|
||||
public static double shootAllSpindexerSpeedIncrease = 0.02;
|
||||
public static double shootAllSpindexerSpeedIncrease = 0.04;
|
||||
public static double shootAllTime = 1.8;
|
||||
|
||||
public static double transferServo_out = 0.15;
|
||||
|
||||
@@ -168,14 +168,6 @@ public class TeleopV3 extends LinearOpMode {
|
||||
PIDFController tController = new PIDFController(tp, ti, td, tf);
|
||||
|
||||
tController.setTolerance(0.001);
|
||||
//
|
||||
// if (redAlliance) {
|
||||
// robot.limelight.pipelineSwitch(3);
|
||||
// } else {
|
||||
// robot.limelight.pipelineSwitch(2);
|
||||
// }
|
||||
|
||||
// robot.limelight.start();
|
||||
|
||||
Turret turret = new Turret(robot, TELE, robot.limelight);
|
||||
robot.light.setPosition(1);
|
||||
@@ -264,57 +256,6 @@ public class TeleopV3 extends LinearOpMode {
|
||||
|
||||
}
|
||||
|
||||
// if (autoSpintake) {
|
||||
//
|
||||
// if (!servo.spinEqual(spindexPos) && !gamepad1.right_bumper) {
|
||||
//
|
||||
//
|
||||
// robot.spin1.setPosition(spindexPos);
|
||||
// robot.spin2.setPosition(1-spindexPos);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// if (gamepad1.right_bumper) {
|
||||
//
|
||||
// shootAll = false;
|
||||
//
|
||||
// intakeTicker++;
|
||||
//
|
||||
//// if (intakeTicker % 20 < 2) {
|
||||
////
|
||||
//// robot.spin1.setPower(-1);
|
||||
//// robot.spin2.setPower(1);
|
||||
////
|
||||
//// } else if (intakeTicker % 20 < 10) {
|
||||
//// robot.spin1.setPower(-0.5);
|
||||
//// robot.spin2.setPower(0.5);
|
||||
//// } else if (intakeTicker % 20 < 12) {
|
||||
//// robot.spin1.setPower(1);
|
||||
//// robot.spin2.setPower(-1);
|
||||
//// } else {
|
||||
//// robot.spin1.setPower(0.5);
|
||||
//// robot.spin2.setPower(-0.5);
|
||||
//// }
|
||||
//
|
||||
// robot.intake.setPower(1);
|
||||
// intakeStamp = getRuntime();
|
||||
// TELE.addData("Reverse?", reverse);
|
||||
// TELE.update();
|
||||
// } else {
|
||||
// if (!servo.spinEqual(spindexPos)) {
|
||||
// robot.spin1.setPosition(spindexPos);
|
||||
// robot.spin2.setPosition(1-spindexPos);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// spindexPos = spindexer_intakePos1;
|
||||
//
|
||||
// robot.intake.setPower(0);
|
||||
//
|
||||
// intakeTicker = 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
//COLOR:
|
||||
|
||||
double s1D = robot.color1.getDistance(DistanceUnit.MM);
|
||||
@@ -447,31 +388,6 @@ public class TeleopV3 extends LinearOpMode {
|
||||
//SHOOTER:
|
||||
flywheel.manageFlywheel(vel);
|
||||
|
||||
//TODO: test the camera teleop code
|
||||
|
||||
// if (y < 0.3 && y > -0.3 && x < 0.3 && x > -0.3 && rx < 0.3 && rx > -0.3) { //not moving
|
||||
// double bearing;
|
||||
//
|
||||
// LLResult result = robot.light.getLatestResult();
|
||||
// if (result != null) {
|
||||
// if (result.isValid()) {
|
||||
// bearing = result.getTx() * bMult;
|
||||
//
|
||||
// double bearingCorrection = bearing / bDiv;
|
||||
//
|
||||
// error += bearingCorrection;
|
||||
//
|
||||
// camTicker++;
|
||||
// TELE.addData("tx", bearingCorrection);
|
||||
// TELE.addData("ty", result.getTy());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
// camTicker = 0;
|
||||
// overrideTurr = false;
|
||||
// }
|
||||
|
||||
//HOOD:
|
||||
|
||||
if (targetingHood) {
|
||||
@@ -491,7 +407,6 @@ public class TeleopV3 extends LinearOpMode {
|
||||
autoHoodOffset += 0.02;
|
||||
|
||||
}
|
||||
//
|
||||
|
||||
if (gamepad2.cross) {
|
||||
manualOffset = 0;
|
||||
@@ -527,77 +442,6 @@ public class TeleopV3 extends LinearOpMode {
|
||||
// yOffset = robotY;
|
||||
// headingOffset = robotHeading;
|
||||
// }
|
||||
// }
|
||||
|
||||
//if (gamepad1.left_bumper && !enableSpindexerManager) {
|
||||
|
||||
// robot.transferServo.setPosition(transferServo_out);
|
||||
|
||||
// autoSpintake = false;
|
||||
//
|
||||
// intakeTicker++;
|
||||
//
|
||||
// if (intakeTicker % 10 < 1) {
|
||||
//
|
||||
// robot.spin1.setPower(-1);
|
||||
// robot.spin2.setPower(1);
|
||||
//
|
||||
// } else if (intakeTicker % 10 < 5) {
|
||||
// robot.spin1.setPower(-0.5);
|
||||
// robot.spin2.setPower(0.5);
|
||||
// } else if (intakeTicker % 10 < 6) {
|
||||
// robot.spin1.setPower(1);
|
||||
// robot.spin2.setPower(-1);
|
||||
// } else {
|
||||
// robot.spin1.setPower(0.5);
|
||||
// robot.spin2.setPower(-0.5);
|
||||
// }
|
||||
//
|
||||
// intake = false;
|
||||
// reject = false;
|
||||
//
|
||||
// robot.intake.setPower(0.5);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// if (gamepad1.leftBumperWasReleased() && !enableSpindexerManager) {
|
||||
// shootStamp = getRuntime();
|
||||
// shootAll = true;
|
||||
//
|
||||
// shooterTicker = 0;
|
||||
// }
|
||||
//
|
||||
// if (shootAll && !enableSpindexerManager) {
|
||||
//
|
||||
// TELE.addData("100% works", shootOrder);
|
||||
//
|
||||
// intake = false;
|
||||
// reject = false;
|
||||
//
|
||||
// shooterTicker++;
|
||||
//
|
||||
// spindexPos = spindexer_intakePos1;
|
||||
//
|
||||
// if (getRuntime() - shootStamp < 3.5) {
|
||||
//
|
||||
// robot.transferServo.setPosition(transferServo_in);
|
||||
//
|
||||
// autoSpintake = false;
|
||||
//
|
||||
// robot.spin1.setPower(-spinPow);
|
||||
// robot.spin2.setPower(spinPow);
|
||||
//
|
||||
// } else {
|
||||
// robot.transferServo.setPosition(transferServo_out);
|
||||
// spindexPos = spindexer_intakePos1;
|
||||
//
|
||||
// shootAll = false;
|
||||
//
|
||||
// autoSpintake = true;
|
||||
//
|
||||
// robot.transferServo.setPosition(transferServo_out);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
if (enableSpindexerManager) {
|
||||
@@ -672,12 +516,12 @@ public class TeleopV3 extends LinearOpMode {
|
||||
|
||||
|
||||
if (shooterTicker == 0) {
|
||||
spindexer.prepareShootAll();
|
||||
spindexer.prepareShootAllContinous();
|
||||
TELE.addLine("preparing to shoot");
|
||||
} else if (shooterTicker == 2) {
|
||||
//robot.transferServo.setPosition(transferServo_in);
|
||||
spindexer.shootAll();
|
||||
TELE.addLine("starting to shoot");
|
||||
// } else if (shooterTicker == 2) {
|
||||
// //robot.transferServo.setPosition(transferServo_in);
|
||||
// spindexer.shootAll();
|
||||
// TELE.addLine("starting to shoot");
|
||||
} else if (!spindexer.shootAllComplete()) {
|
||||
robot.transferServo.setPosition(transferServo_in);
|
||||
TELE.addLine("shoot");
|
||||
@@ -699,7 +543,6 @@ public class TeleopV3 extends LinearOpMode {
|
||||
|
||||
shootAll = false;
|
||||
spindexer.resetSpindexer();
|
||||
spindexer.processIntake();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ import com.arcrobotics.ftclib.controller.PIDFController;
|
||||
import com.qualcomm.robotcore.hardware.HardwareMap;
|
||||
|
||||
import static org.firstinspires.ftc.teamcode.constants.Color.*;
|
||||
import static org.firstinspires.ftc.teamcode.constants.ServoPositions.shootAllSpindexerSpeedIncrease;
|
||||
import static org.firstinspires.ftc.teamcode.constants.ServoPositions.spinEndPos;
|
||||
import static org.firstinspires.ftc.teamcode.constants.ServoPositions.spinStartPos;
|
||||
import static org.firstinspires.ftc.teamcode.constants.ServoPositions.spindexer_intakePos1;
|
||||
import static org.firstinspires.ftc.teamcode.constants.ServoPositions.spindexer_intakePos2;
|
||||
import static org.firstinspires.ftc.teamcode.constants.ServoPositions.spindexer_intakePos3;
|
||||
@@ -72,7 +75,9 @@ public class Spindexer {
|
||||
SHOOTMOVING,
|
||||
SHOOTWAIT,
|
||||
SHOOT_ALL_PREP,
|
||||
SHOOT_ALL_READY
|
||||
SHOOT_ALL_READY,
|
||||
SHOOT_PREP_CONTINOUS,
|
||||
SHOOT_CONTINOUS
|
||||
}
|
||||
|
||||
int shootWaitCount = 0;
|
||||
@@ -143,6 +148,9 @@ public class Spindexer {
|
||||
ballPositions[pos].isEmpty = true;
|
||||
ballPositions[pos].foundEmpty = 0;
|
||||
ballPositions[pos].ballColor = BallColor.UNKNOWN;
|
||||
distanceRearCenter = 61;
|
||||
distanceFrontDriver = 61;
|
||||
distanceFrontPassenger = 61;
|
||||
}
|
||||
|
||||
public void resetSpindexer () {
|
||||
@@ -263,8 +271,8 @@ public class Spindexer {
|
||||
private void moveSpindexerToPos(double pos) {
|
||||
robot.spin1.setPosition(pos);
|
||||
robot.spin2.setPosition(1-pos);
|
||||
double currentPos = servos.getSpinPos();
|
||||
if (!servos.spinEqual(pos) && Math.abs(prevPos - currentPos) <= 0){
|
||||
// double currentPos = servos.getSpinPos();
|
||||
// if (!servos.spinEqual(pos) && Math.abs(prevPos - currentPos) <= 0){
|
||||
// if (currentPos > pos){
|
||||
// robot.spin1.setPosition(servos.getSpinPos() + 0.05);
|
||||
// robot.spin2.setPosition(1 - servos.getSpinPos() - 0.05);
|
||||
@@ -272,8 +280,8 @@ public class Spindexer {
|
||||
// robot.spin1.setPosition(servos.getSpinPos() - 0.05);
|
||||
// robot.spin2.setPosition(1 - servos.getSpinPos() + 0.05);
|
||||
// }
|
||||
}
|
||||
prevPos = currentPos;
|
||||
// }
|
||||
// prevPos = currentPos;
|
||||
}
|
||||
|
||||
public void stopSpindexer() {
|
||||
@@ -309,6 +317,8 @@ public class Spindexer {
|
||||
public boolean isFull () {
|
||||
return (!ballPositions[0].isEmpty && !ballPositions[1].isEmpty && !ballPositions[2].isEmpty);
|
||||
}
|
||||
|
||||
private double intakeTicker = 0;
|
||||
public boolean processIntake() {
|
||||
|
||||
switch (currentIntakeState) {
|
||||
@@ -359,15 +369,15 @@ public class Spindexer {
|
||||
commandedIntakePosition = 0;
|
||||
currentIntakeState = Spindexer.IntakeState.MOVING;
|
||||
}
|
||||
proposedTravelDistance = Math.abs(intakePositions[1] - currentSpindexerPos);
|
||||
//proposedTravelDistance = Math.abs(intakePositions[1] - currentSpindexerPos);
|
||||
//if (ballPositions[1].isEmpty && (proposedTravelDistance < commandedtravelDistance)) {
|
||||
if (ballPositions[1].isEmpty) {
|
||||
else if (ballPositions[1].isEmpty) {
|
||||
// Position 2
|
||||
commandedIntakePosition = 1;
|
||||
currentIntakeState = Spindexer.IntakeState.MOVING;
|
||||
}
|
||||
proposedTravelDistance = Math.abs(intakePositions[2] - currentSpindexerPos);
|
||||
if (ballPositions[2].isEmpty) {
|
||||
//proposedTravelDistance = Math.abs(intakePositions[2] - currentSpindexerPos);
|
||||
else if (ballPositions[2].isEmpty) {
|
||||
// Position 3
|
||||
commandedIntakePosition = 2;
|
||||
currentIntakeState = Spindexer.IntakeState.MOVING;
|
||||
@@ -383,8 +393,13 @@ public class Spindexer {
|
||||
case MOVING:
|
||||
// Stopping when we get to the new position
|
||||
if (servos.spinEqual(intakePositions[commandedIntakePosition])) {
|
||||
currentIntakeState = Spindexer.IntakeState.INTAKE;
|
||||
stopSpindexer();
|
||||
if (intakeTicker > 1){
|
||||
currentIntakeState = Spindexer.IntakeState.INTAKE;
|
||||
stopSpindexer();
|
||||
intakeTicker = 0;
|
||||
} else {
|
||||
intakeTicker++;
|
||||
}
|
||||
//detectBalls(false, false);
|
||||
} else {
|
||||
// Keep moving the spindexer
|
||||
@@ -476,10 +491,33 @@ public class Spindexer {
|
||||
//detectBalls(true, false);
|
||||
}
|
||||
// Keep moving the spindexer
|
||||
spindexerOuttakeWiggle *= -1.01;
|
||||
spindexerOuttakeWiggle *= -1.0;
|
||||
moveSpindexerToPos(outakePositions[commandedIntakePosition]+spindexerOuttakeWiggle);
|
||||
break;
|
||||
|
||||
case SHOOT_PREP_CONTINOUS:
|
||||
if (servos.spinEqual(spinStartPos)){
|
||||
currentIntakeState = Spindexer.IntakeState.SHOOT_CONTINOUS;
|
||||
} else {
|
||||
moveSpindexerToPos(spinStartPos);
|
||||
}
|
||||
break;
|
||||
|
||||
case SHOOT_CONTINOUS:
|
||||
ballPositions[0].isEmpty = false;
|
||||
ballPositions[1].isEmpty = false;
|
||||
ballPositions[2].isEmpty = false;
|
||||
if (servos.getSpinPos() > spinEndPos){
|
||||
currentIntakeState = IntakeState.FINDNEXT;
|
||||
} else {
|
||||
double spinPos = robot.spin1.getPosition() + shootAllSpindexerSpeedIncrease;
|
||||
if (spinPos > spinEndPos + 0.03){
|
||||
spinPos = spinEndPos + 0.03;
|
||||
}
|
||||
moveSpindexerToPos(spinPos);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Statements to execute if no case matches
|
||||
}
|
||||
@@ -539,12 +577,21 @@ public class Spindexer {
|
||||
public void prepareShootAll(){
|
||||
currentIntakeState = Spindexer.IntakeState.SHOOT_ALL_PREP;
|
||||
}
|
||||
public void prepareShootAllContinous(){
|
||||
currentIntakeState = Spindexer.IntakeState.SHOOT_PREP_CONTINOUS;
|
||||
}
|
||||
public void shootAll () {
|
||||
ballPositions[0].isEmpty = false;
|
||||
ballPositions[1].isEmpty = false;
|
||||
ballPositions[2].isEmpty = false;
|
||||
currentIntakeState = Spindexer.IntakeState.SHOOTNEXT;
|
||||
}
|
||||
public void shootAllContinous(){
|
||||
ballPositions[0].isEmpty = false;
|
||||
ballPositions[1].isEmpty = false;
|
||||
ballPositions[2].isEmpty = false;
|
||||
currentIntakeState = Spindexer.IntakeState.SHOOT_CONTINOUS;
|
||||
}
|
||||
|
||||
public boolean shootAllComplete ()
|
||||
{
|
||||
@@ -552,7 +599,9 @@ public class Spindexer {
|
||||
(currentIntakeState != Spindexer.IntakeState.SHOOT_ALL_READY) &&
|
||||
(currentIntakeState != Spindexer.IntakeState.SHOOTMOVING) &&
|
||||
(currentIntakeState != Spindexer.IntakeState.SHOOTNEXT) &&
|
||||
(currentIntakeState != Spindexer.IntakeState.SHOOTWAIT));
|
||||
(currentIntakeState != Spindexer.IntakeState.SHOOTWAIT) &&
|
||||
(currentIntakeState != Spindexer.IntakeState.SHOOT_PREP_CONTINOUS) &&
|
||||
(currentIntakeState != Spindexer.IntakeState.SHOOT_CONTINOUS));
|
||||
}
|
||||
|
||||
void shootAllToIntake () {
|
||||
|
||||
Reference in New Issue
Block a user