diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index 06b1b30..f9bbba7 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -37,7 +37,7 @@ public final class Constants { public static final double LOOP_TIME = 0.02; public static final class SwerveDriveConstants { - public static final double ROTATION_SPEED = 2.0; + public static final double ROTATION_SPEED = 2.3; public static final double WIDTH = 23.75; public static final double HEIGHT = 23.75; public static final double JOYSTICK_TO_METERS_PER_SECOND_FAST = 11; diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index e770cfb..ce4ccef 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -226,12 +226,22 @@ public class RobotContainer { configureButtonBindings(); /* Default Commands */ // Swerve Drive with Input - m_robotSwerveDrive.setDefaultCommand( - new RunCommand(() -> m_robotSwerveDrive.driveWithInput( getDriverController().getLeftX(), - getDriverController().getLeftY(), - getDriverController().getRightX(), - getDriverController().getRightY(), - true), m_robotSwerveDrive).withName("Swerve driveWithInput defaultCommand")); + m_robotSwerveDrive.setDefaultCommand( + new RunCommand(() -> { + if (currentDriveMode.equals(DriveMode.ON)) { + m_robotSwerveDrive.driveWithInput( getDriverController().getLeftX(), + getDriverController().getLeftY(), + getDriverController().getRightX(), + getDriverController().getRightY(), + true); } + if (currentDriveMode.equals(DriveMode.OFF)) { + m_robotSwerveDrive.driveWithInput( 0, + 0, + 0, + 0, + false); + }} + , m_robotSwerveDrive).withName("Swerve driveWithInput defaultCommand")); // Intake with Triggers m_robotIntake.setDefaultCommand( @@ -256,7 +266,7 @@ public class RobotContainer { // Hood Manual m_robotHood.setDefaultCommand( new RunCommand(() -> { - if (RobotContainer.currentControlMode.equals(ControlMode.SHOOTER)) { m_robotHood.runHood(getOperatorController().getRightY()); } + if (RobotContainer.currentControlMode.equals(ControlMode.SHOOTER)) { m_robotHood.runHood(getOperatorController().getLeftY()); } if (RobotContainer.currentControlMode.equals(ControlMode.CLIMBER)) { m_robotHood.runHood(0); } }, m_robotHood)); @@ -302,6 +312,8 @@ public class RobotContainer { .whenPressed(() -> m_robotSwerveDrive.highSpeed(true)); + new JoystickButton(getDriverController(), XboxController.Button.kA.value) + .whenPressed(new InstantCommand()); //! Operator Buttons @@ -384,13 +396,13 @@ public class RobotContainer { new JoystickButton(getButtonBox(), ButtonBox.Button.kMiddleSwitch.value) .whenPressed(new InstantCommand(() -> currentControlMode = ControlMode.CLIMBER)) .whenReleased(new InstantCommand(() -> currentControlMode = ControlMode.SHOOTER)); - new JoystickButton(getButtonBox(), ButtonBox.Button.kRightSwitch.value) - .whenPressed(new InstantCommand(() -> currentControlMode = ControlMode.CLIMBER)) - .whenReleased(new InstantCommand(() -> currentControlMode = ControlMode.SHOOTER)); + // new JoystickButton(getButtonBox(), ButtonBox.Button.kRightSwitch.value) + // .whenPressed(new InstantCommand(() -> currentControlMode = ControlMode.)) + // .whenReleased(new InstantCommand(() -> currentControlMode = ControlMode.SHOOTER)); - // new JoystickButton(getButtonBox(), ButtonBox.Button.kRightSwitch.value) - // .whileHeld(new InstantCommand(() -> currentDriveMode = DriveMode.OFF)) - // .whenReleased(new InstantCommand(() -> currentDriveMode = DriveMode.ON)); + new JoystickButton(getButtonBox(), ButtonBox.Button.kRightSwitch.value) + .whileHeld(new InstantCommand(() -> currentDriveMode = DriveMode.OFF)) + .whenReleased(new InstantCommand(() -> currentDriveMode = DriveMode.ON)); // Left Button > Extender In new JoystickButton(getButtonBox(), ButtonBox.Button.kLeftButton.value) @@ -489,7 +501,7 @@ public class RobotContainer { // ! DRIVE BACKWARDS AND SHOOT (HOPEFULLY) return new SequentialCommandGroup( new InstantCommand(() -> m_robotSwerveDrive.resetGyro(), m_robotSwerveDrive), // * reset gyro before moving - new DriveWithInputForTime(m_robotSwerveDrive, new double[] {1.0, 0.0, 0.0, 0.0}, (4.0 * 12) / distancePerSecond),//0.269), // * go backwards three feet + new DriveWithInputForTime(m_robotSwerveDrive, new double[] {1.0, 0.0, 0.0, 0.0}, (5.0 * 12) / distancePerSecond),//0.269), // * go backwards three feet new InstantCommand(() -> m_robotSwerveDrive.stopModules(), m_robotSwerveDrive), // * brake weirdAutoShootingGroup, // * shoot