teleop tweaks
This commit is contained in:
@@ -34,6 +34,8 @@ public class TeleopV4 extends LinearOpMode {
|
|||||||
public static Pose teleStart = new Pose(0,0,0);
|
public static Pose teleStart = new Pose(0,0,0);
|
||||||
|
|
||||||
private boolean firstTickFull = true;
|
private boolean firstTickFull = true;
|
||||||
|
private boolean intakeFull = true;
|
||||||
|
private boolean shooting = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runOpMode() throws InterruptedException {
|
public void runOpMode() throws InterruptedException {
|
||||||
@@ -102,6 +104,7 @@ public class TeleopV4 extends LinearOpMode {
|
|||||||
|
|
||||||
if (isStopRequested()) return;
|
if (isStopRequested()) return;
|
||||||
|
|
||||||
|
int emptyTicks = 0;
|
||||||
while (opModeIsActive()) {
|
while (opModeIsActive()) {
|
||||||
//Drivetrain
|
//Drivetrain
|
||||||
drivetrain.drive(
|
drivetrain.drive(
|
||||||
@@ -141,18 +144,18 @@ public class TeleopV4 extends LinearOpMode {
|
|||||||
if (gamepad1.triangleWasPressed()){
|
if (gamepad1.triangleWasPressed()){
|
||||||
VelocityCommander.lockFront = true;
|
VelocityCommander.lockFront = true;
|
||||||
VelocityCommander.lockBack = false;
|
VelocityCommander.lockBack = false;
|
||||||
TELE.addData("Front?:", VelocityCommander.lockFront);
|
TELE.addData("Front?:", true);
|
||||||
TELE.addData("Back?:", VelocityCommander.lockBack);
|
TELE.addData("Back?:", false);
|
||||||
} else if (gamepad1.squareWasPressed()){
|
} else if (gamepad1.squareWasPressed()){
|
||||||
VelocityCommander.lockBack = true;
|
VelocityCommander.lockBack = true;
|
||||||
VelocityCommander.lockFront = false;
|
VelocityCommander.lockFront = false;
|
||||||
TELE.addData("Front?:", VelocityCommander.lockFront);
|
TELE.addData("Front?:", false);
|
||||||
TELE.addData("Back?:", VelocityCommander.lockBack);
|
TELE.addData("Back?:", true);
|
||||||
} else if (gamepad1.circleWasPressed()){
|
} else if (gamepad1.circleWasPressed()){
|
||||||
VelocityCommander.lockBack = false;
|
VelocityCommander.lockBack = false;
|
||||||
VelocityCommander.lockFront = false;
|
VelocityCommander.lockFront = false;
|
||||||
TELE.addData("Front?:", VelocityCommander.lockFront);
|
TELE.addData("Front?:", false);
|
||||||
TELE.addData("Back?:", VelocityCommander.lockBack);
|
TELE.addData("Back?:", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
shooter.update(robot.voltage.getVoltage());
|
shooter.update(robot.voltage.getVoltage());
|
||||||
@@ -169,11 +172,23 @@ public class TeleopV4 extends LinearOpMode {
|
|||||||
state == SpindexerTransferIntake.RapidMode.HOLD_BALLS)) {
|
state == SpindexerTransferIntake.RapidMode.HOLD_BALLS)) {
|
||||||
|
|
||||||
spindexerTransferIntake.setRapidMode(SpindexerTransferIntake.RapidMode.OPEN_GATE);
|
spindexerTransferIntake.setRapidMode(SpindexerTransferIntake.RapidMode.OPEN_GATE);
|
||||||
SpindexerTransferIntake.intakeFull = false;
|
intakeFull = false;
|
||||||
|
firstTickFull = true;
|
||||||
|
shooting = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state != SpindexerTransferIntake.RapidMode.OPEN_GATE && state != SpindexerTransferIntake.RapidMode.SHOOT){
|
||||||
|
shooting = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (robot.insideBeam.isPressed() && robot.outsideBeam.isPressed() && !shooting){
|
||||||
|
intakeFull = true;
|
||||||
|
} else {
|
||||||
|
intakeFull = false;
|
||||||
firstTickFull = true;
|
firstTickFull = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SpindexerTransferIntake.intakeFull && firstTickFull){
|
if (intakeFull && firstTickFull){
|
||||||
gamepad1.rumble(100);
|
gamepad1.rumble(100);
|
||||||
firstTickFull = false;
|
firstTickFull = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,7 +274,6 @@ public class SpindexerTransferIntake {
|
|||||||
private int greenTicks = 0;
|
private int greenTicks = 0;
|
||||||
private int ballTicks = 0;
|
private int ballTicks = 0;
|
||||||
private int holdBallsTicker = 0;
|
private int holdBallsTicker = 0;
|
||||||
public static boolean intakeFull = true;
|
|
||||||
public void update() {
|
public void update() {
|
||||||
|
|
||||||
// TELE.addData("Sorted State", sortedIntakeStates);
|
// TELE.addData("Sorted State", sortedIntakeStates);
|
||||||
@@ -376,7 +375,6 @@ public class SpindexerTransferIntake {
|
|||||||
robot.setTransferPower(0);
|
robot.setTransferPower(0);
|
||||||
robot.setIntakePower(0.1);
|
robot.setIntakePower(0.1);
|
||||||
robot.setTransferServoPos(ServoPositions.transferServo_in);
|
robot.setTransferServoPos(ServoPositions.transferServo_in);
|
||||||
intakeFull = true;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
holdBallsTicker++;
|
holdBallsTicker++;
|
||||||
|
|||||||
Reference in New Issue
Block a user