This commit is contained in:
Abhishrek05
2024-02-22 19:56:56 -07:00
parent ef598ee7bf
commit 3e1b7188f8
3 changed files with 18 additions and 10 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ public final class Constants {
public static final double CORRECTION_MIN = 10; public static final double CORRECTION_MIN = 10;
public static final double CORRECTION_MAX = 50; public static final double CORRECTION_MAX = 50;
public static final double SLOW_SPEED = 0.8; public static final double SLOW_SPEED = 0.4;
public static final double FAST_SPEED = 1.0; public static final double FAST_SPEED = 1.0;
public static final double TURBO_SPEED = 4.0; public static final double TURBO_SPEED = 4.0;
@@ -78,8 +78,8 @@ public class RobotContainer {
private Command intakeToShootStuff = new ArmIntakeIn(m_robotIntake, m_robotShooter); private Command intakeToShootStuff = new ArmIntakeIn(m_robotIntake, m_robotShooter);
private SequentialCommandGroup intakeToShoot = new SequentialCommandGroup( private SequentialCommandGroup intakeToShoot = new SequentialCommandGroup(
new InstantCommand(() -> m_robotIntake.talonPIDIn()), new InstantCommand(() -> m_robotIntake.talonPIDIn())
new InstantCommand(() -> m_robotShooter.spin()) //new InstantCommand(() -> m_robotShooter.spin())
); );
// private SequentialCommandGroup outtakeToShootFull = new SequentialCommandGroup( // private SequentialCommandGroup outtakeToShootFull = new SequentialCommandGroup(
@@ -125,10 +125,10 @@ public class RobotContainer {
); );
/* Autos */ /* Autos */
private Command taxi = new InstantCommand(); // new JoystickPlayback(m_robotSwerveDrive, "Taxi.txt"); private Command taxi = new JoystickPlayback(m_robotSwerveDrive, "Taxi.txt"); //new InstantCommand();
private Command startLeftMoveRight = new InstantCommand(); // new JoystickPlayback(m_robotSwerveDrive, "StartLeftMoveRight.txt"); private Command startLeftMoveRight = new InstantCommand(); // new JoystickPlayback(m_robotSwerveDrive, "StartLeftMoveRight.txt");
private Command startRightMoveLeft = new InstantCommand(); // new JoystickPlayback(m_robotSwerveDrive, "StartRightMoveLeft.txt"); private Command startRightMoveLeft = new InstantCommand(); // new JoystickPlayback(m_robotSwerveDrive, "StartRightMoveLeft.txt");
private Command interrupt = new InstantCommand(() -> {}, m_robotSwerveDrive, m_robotIntake, m_robotShooter); private Command interrupt = new InstantCommand(() -> {}, m_robotIntake, m_robotShooter);
private SequentialCommandGroup oneNoteStartingSpeaker = new SequentialCommandGroup ( private SequentialCommandGroup oneNoteStartingSpeaker = new SequentialCommandGroup (
new InstantCommand(() -> m_robotShooter.spin(), m_robotShooter), new InstantCommand(() -> m_robotShooter.spin(), m_robotShooter),
@@ -159,6 +159,11 @@ public class RobotContainer {
taxi.asProxy() taxi.asProxy()
); );
private SequentialCommandGroup emergencyRetract = new SequentialCommandGroup(
interrupt,
new InstantCommand(() -> m_robotIntake.talonPIDIn())
);
private SequentialCommandGroup twoNoteStartingFromSpeaker = new SequentialCommandGroup( private SequentialCommandGroup twoNoteStartingFromSpeaker = new SequentialCommandGroup(
new InstantCommand(() -> m_robotShooter.spin(), m_robotShooter), new InstantCommand(() -> m_robotShooter.spin(), m_robotShooter),
new WaitCommand(1).asProxy(), new WaitCommand(1).asProxy(),
@@ -272,11 +277,11 @@ public class RobotContainer {
//? /* Operator Buttons */ //? /* Operator Buttons */
new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON) new JoystickButton(getDeadbandedOperatorController(), XboxController.B_BUTTON)
.onTrue(new InstantCommand(() -> m_robotIntake.talonPIDIn())) .onTrue(new InstantCommand(() -> m_robotIntake.talonPIDIn()))
.onFalse(new InstantCommand(() -> m_robotIntake.talonStopArmMotor())); .onFalse(new InstantCommand(() -> m_robotIntake.talonStopArmMotor()));
new JoystickButton(getDeadbandedOperatorController(), XboxController.B_BUTTON) new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON)
.onTrue(new InstantCommand(() -> m_robotIntake.talonPIDOut())) .onTrue(new InstantCommand(() -> m_robotIntake.talonPIDOut()))
.onFalse(new InstantCommand(() -> m_robotIntake.talonStopArmMotor())); .onFalse(new InstantCommand(() -> m_robotIntake.talonStopArmMotor()));
@@ -311,9 +316,12 @@ public class RobotContainer {
new JoystickButton(getDeadbandedOperatorController(), XboxController.LEFT_JOYSTICK_BUTTON) new JoystickButton(getDeadbandedOperatorController(), XboxController.LEFT_JOYSTICK_BUTTON)
.onTrue(new InstantCommand(() -> m_robotShooter.spin(), m_robotShooter)); .onTrue(new InstantCommand(() -> m_robotShooter.spin(), m_robotShooter));
// new JoystickButton(getDeadbandedOperatorController(), XboxController.RIGHT_JOYSTICK_BUTTON)
// .onTrue(new InstantCommand(() -> m_robotIntake.talonSpinIntakeMotor(), m_robotIntake))
// .onFalse(new InstantCommand(() -> m_robotIntake.talonStopIntakeMotors(), m_robotIntake));
new JoystickButton(getDeadbandedOperatorController(), XboxController.RIGHT_JOYSTICK_BUTTON) new JoystickButton(getDeadbandedOperatorController(), XboxController.RIGHT_JOYSTICK_BUTTON)
.onTrue(new InstantCommand(() -> m_robotIntake.talonSpinIntakeMotor(), m_robotIntake)) .onTrue(emergencyRetract);
.onFalse(new InstantCommand(() -> m_robotIntake.talonStopIntakeMotors(), m_robotIntake));
} }
+1 -1
View File
@@ -99,7 +99,7 @@ public class RobotGyro implements Gyro {
resetZeroValues(); resetZeroValues();
if (m_isGyroAPigeon) { if (m_isGyroAPigeon) {
m_pigeon.setYaw(180); m_pigeon.setYaw(0);
} else { } else {
m_navX.reset(); m_navX.reset();
} }