diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 58a214e..817be6c 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -30,17 +30,17 @@ public static class constLED { } public static class constIntake { - public static final double INTAKE_EJECT_VELOCITY = -0.5; - public static final double INTAKE_VELOCITY = 0.5; + public static final double INTAKE_EJECT_VELOCITY = 1; + public static final double INTAKE_VELOCITY = -1; } public static class constHopper { - public static final double HOPPER_ORIENTATION_SPEED = 0.5; + public static final double HOPPER_ORIENTATION_SPEED = 1; } public static class constShooter { - public static final double PROPEL_MOTOR_VELOCITY = 0.6; - public static final double SPIRAL_MOTOR_VELOCITY = 0.8; + public static final double PROPEL_MOTOR_VELOCITY = -0.8; + public static final double SPIRAL_MOTOR_VELOCITY = 0.9; public static final double PROPEL_MOTOR_VELOCITY_EJECT = 0.3; public static final double SPIRAL_MOTOR_VELOCITY_EJECT = 0.3; public static final double PROPEL_MOTOR_VELOCITY_EJECT_REQUIREMENT = 0.2; @@ -48,7 +48,7 @@ public static class constShooter { } public static class constStager { - public static final double STAGER_MOTOR_VELOCITY = 0.3; - public static final double TOP_STAGER_MOTOR_VELOCITY = 0.3; + public static final double STAGER_MOTOR_VELOCITY = -.8; + public static final double TOP_STAGER_MOTOR_VELOCITY = -.8; } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index ca01572..c5f27d3 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -16,6 +16,7 @@ import frc.robot.subsystems.LED; import frc.robot.subsystems.Shooter; import frc.robot.subsystems.Stager; +import frc.robot.commands.EjectGP; public class RobotContainer { private final SN_XboxController m_driverController = new SN_XboxController(RobotMap.mapControllers.DRIVER_USB); @@ -32,6 +33,7 @@ public class RobotContainer { private final Shoot com_Shoot = new Shoot(subStager, subShooter, subLED); private final intakeHopper com_IntakeHopper = new intakeHopper(subHopper, subStager, subLED); private final EjectShooter com_EjectShooter = new EjectShooter(subStager, subShooter, subLED); + private final EjectGP com_EjectGP = new EjectGP(subIntake, subLED); public RobotContainer() { subDrivetrain.setDefaultCommand(com_Drive); @@ -42,10 +44,11 @@ public RobotContainer() { private void configureBindings() { m_driverController.btn_LeftTrigger.whileTrue(com_IntakeGround); - m_driverController.btn_A.onTrue(com_PrepShooter); + m_driverController.btn_A.whileTrue(com_PrepShooter); m_driverController.btn_B.whileTrue(com_IntakeHopper); - m_driverController.btn_LeftBumper.whileTrue(com_EjectShooter); - m_driverController.btn_RightTrigger.onTrue(com_Shoot); + m_driverController.btn_RightBumper.whileTrue(com_EjectShooter); + m_driverController.btn_RightTrigger.whileTrue(com_Shoot); + m_driverController.btn_LeftBumper.whileTrue(com_EjectGP); } diff --git a/src/main/java/frc/robot/commands/Shoot.java b/src/main/java/frc/robot/commands/Shoot.java index 8abeb9b..c9a2f45 100644 --- a/src/main/java/frc/robot/commands/Shoot.java +++ b/src/main/java/frc/robot/commands/Shoot.java @@ -27,16 +27,18 @@ public Shoot(Stager passedStager, Shooter passedShooter, LED shootLED) { // Called when the command is initially scheduled. @Override public void initialize() { - globalShooter.setPropelMotorVelocity(Constants.constShooter.PROPEL_MOTOR_VELOCITY); - globalShooter.setSpiralMotorVelocity(Constants.constShooter.SPIRAL_MOTOR_VELOCITY); - if ((globalShooter.getPropelMotorVelocity() >= Constants.constShooter.PROPEL_MOTOR_VELOCITY) - && (globalShooter.getSpiralMotorVelocity() >= Constants.constShooter.SPIRAL_MOTOR_VELOCITY)) { - globalStager.setStagerMotorVelocity(Constants.constStager.STAGER_MOTOR_VELOCITY); - globalStager.setTopStagerMotorVelocity(Constants.constStager.TOP_STAGER_MOTOR_VELOCITY); - globalLED.setLEDs(constLED.LED_SHOOTING); - } else { - globalStager.setStagerMotorVelocityNuetralOutput(); - } + // globalShooter.setPropelMotorVelocity(Constants.constShooter.PROPEL_MOTOR_VELOCITY); + // globalShooter.setSpiralMotorVelocity(Constants.constShooter.SPIRAL_MOTOR_VELOCITY); + // if ((globalShooter.getPropelMotorVelocity() >= + // Constants.constShooter.PROPEL_MOTOR_VELOCITY) + // && (globalShooter.getSpiralMotorVelocity() >= + // Constants.constShooter.SPIRAL_MOTOR_VELOCITY)) { + globalStager.setStagerMotorVelocity(Constants.constStager.STAGER_MOTOR_VELOCITY); + globalStager.setTopStagerMotorVelocity(Constants.constStager.TOP_STAGER_MOTOR_VELOCITY); + globalLED.setLEDs(constLED.LED_SHOOTING); + // } else { + // globalStager.setStagerMotorVelocityNuetralOutput(); + // } } // Called every time the scheduler runs while the command is scheduled. diff --git a/src/main/java/frc/robot/subsystems/Stager.java b/src/main/java/frc/robot/subsystems/Stager.java index f921688..777b964 100644 --- a/src/main/java/frc/robot/subsystems/Stager.java +++ b/src/main/java/frc/robot/subsystems/Stager.java @@ -39,12 +39,12 @@ public void setStagerMotorVelocityNuetralOutput() { } public boolean getHasGP() { - return hasGP.get(); + return !hasGP.get(); } @Override public void periodic() { // This method will be called once per scheduler run - SmartDashboard.putBoolean("hasGP", !getHasGP()); + SmartDashboard.putBoolean("hasGP", getHasGP()); } }