copied changes from Mr. Kruger's commit
This commit is contained in:
@@ -114,7 +114,6 @@ public class TeleopV4 extends LinearOpMode {
|
|||||||
if (shooter.getState() == Shooter.ShooterState.MANUAL_FLYWHEEL_TRACK_TURR || shooter.getState() == Shooter.ShooterState.MANUAL){
|
if (shooter.getState() == Shooter.ShooterState.MANUAL_FLYWHEEL_TRACK_TURR || shooter.getState() == Shooter.ShooterState.MANUAL){
|
||||||
shooter.setFlywheelVelocity(2500);
|
shooter.setFlywheelVelocity(2500);
|
||||||
robot.setHoodPos(0.6);
|
robot.setHoodPos(0.6);
|
||||||
robot.setTransferPower(-0.8);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shooter.update(robot.voltage.getVoltage());
|
shooter.update(robot.voltage.getVoltage());
|
||||||
@@ -144,6 +143,7 @@ public class TeleopV4 extends LinearOpMode {
|
|||||||
|
|
||||||
if (gamepad1.right_bumper && state != SpindexerTransferIntake.RapidMode.OPEN_GATE && state != SpindexerTransferIntake.RapidMode.SHOOT) {
|
if (gamepad1.right_bumper && state != SpindexerTransferIntake.RapidMode.OPEN_GATE && state != SpindexerTransferIntake.RapidMode.SHOOT) {
|
||||||
robot.setIntakePower(1);
|
robot.setIntakePower(1);
|
||||||
|
robot.setTransferPower(-0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gamepad2.leftBumperWasPressed()){
|
if (gamepad2.leftBumperWasPressed()){
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class NewShooterTest extends LinearOpMode {
|
|||||||
public static int flywheelVelo = 0;
|
public static int flywheelVelo = 0;
|
||||||
public static double hoodPos = 0.5;
|
public static double hoodPos = 0.5;
|
||||||
public static double transferPower = -0.8;
|
public static double transferPower = -0.8;
|
||||||
// public static double turretPos = 0.51;
|
public static boolean overrideTransferPower = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runOpMode() throws InterruptedException {
|
public void runOpMode() throws InterruptedException {
|
||||||
@@ -84,15 +84,14 @@ public class NewShooterTest extends LinearOpMode {
|
|||||||
gamepad1.left_stick_x
|
gamepad1.left_stick_x
|
||||||
);
|
);
|
||||||
|
|
||||||
if (gamepad1.crossWasPressed()){
|
if (Color.redAlliance){
|
||||||
if (Color.redAlliance){
|
TeleopV4.relocalizePose = new Pose(57.5, 5, 0);
|
||||||
TeleopV4.relocalizePose = new Pose(56, 11, 0);
|
} else {
|
||||||
} else {
|
TeleopV4.relocalizePose = new Pose(-57.5, 5, Math.toRadians(180));
|
||||||
TeleopV4.relocalizePose = new Pose(-56, 11, 180);
|
|
||||||
}
|
|
||||||
follower.setPose(TeleopV4.relocalizePose);
|
|
||||||
gamepad1.rumble(100);
|
|
||||||
}
|
}
|
||||||
|
follower.setPose(TeleopV4.relocalizePose);
|
||||||
|
sleep(500);
|
||||||
|
gamepad1.rumble(100);
|
||||||
|
|
||||||
follower.update();
|
follower.update();
|
||||||
|
|
||||||
@@ -107,7 +106,6 @@ public class NewShooterTest extends LinearOpMode {
|
|||||||
if (shooter.getState() == Shooter.ShooterState.MANUAL_FLYWHEEL_TRACK_TURR || shooter.getState() == Shooter.ShooterState.MANUAL){
|
if (shooter.getState() == Shooter.ShooterState.MANUAL_FLYWHEEL_TRACK_TURR || shooter.getState() == Shooter.ShooterState.MANUAL){
|
||||||
shooter.setFlywheelVelocity(flywheelVelo);
|
shooter.setFlywheelVelocity(flywheelVelo);
|
||||||
robot.setHoodPos(hoodPos);
|
robot.setHoodPos(hoodPos);
|
||||||
robot.setTransferPower(transferPower);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -366,9 +366,10 @@ public class SpindexerTransferIntake {
|
|||||||
case HOLD_BALLS:
|
case HOLD_BALLS:
|
||||||
|
|
||||||
if (robot.insideBeam.isPressed()
|
if (robot.insideBeam.isPressed()
|
||||||
&& robot.outsideBeam.isPressed() && holdBallsTicker > 5) {
|
&& robot.outsideBeam.isPressed() && holdBallsTicker > 10) {
|
||||||
|
|
||||||
robot.setIntakePower(0.1);
|
robot.setIntakePower(0.1);
|
||||||
|
robot.setTransferPower(0);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
holdBallsTicker++;
|
holdBallsTicker++;
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ public class Turret {
|
|||||||
private final double turretMin = 0.05;
|
private final double turretMin = 0.05;
|
||||||
private final double turretMax = 0.95;
|
private final double turretMax = 0.95;
|
||||||
public static boolean limelightUsed = true;
|
public static boolean limelightUsed = true;
|
||||||
public static double B_PID_P = 0.0003, B_PID_I = 0.0, B_PID_D = 0.00003;
|
public static double B_PID_P = 0.00015, B_PID_I = 0.0, B_PID_D = 0.00001;
|
||||||
LLResult result;
|
LLResult result;
|
||||||
PIDController bearingPID;
|
PIDController bearingPID;
|
||||||
boolean bearingAligned = false;
|
boolean bearingAligned = false;
|
||||||
public int LL_COAST_TICKS = 5;
|
public int LL_COAST_TICKS = 5;
|
||||||
public static double TARGET_POSITION_TOLERANCE = 0.5;
|
public static double TARGET_POSITION_TOLERANCE = 0.65;
|
||||||
public static double alphaTX = 0.5;
|
public static double alphaTX = 0.5;
|
||||||
private double targetTx = 0;
|
private double targetTx = 0;
|
||||||
private double currentTrackOffset = 0;
|
private double currentTrackOffset = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user