diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 6f93fdb..d4c201a 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -102,10 +102,10 @@ public final class Constants { public static class HopperConstants { public static final int KICKER_MOTOR_ID = 9; - public static final InvertedValue KICKER_MOTOR_DIRECTION = InvertedValue.CounterClockwise_Positive; + public static final InvertedValue KICKER_MOTOR_DIRECTION = InvertedValue.Clockwise_Positive; public static final int SPINDEXER_MOTOR_ID = 8; - public static final InvertedValue SPINDEXER_MOTOR_DIRECTION = InvertedValue.Clockwise_Positive; - public static final double SPINDEXER_MOTOR_SPEED = 0; + public static final InvertedValue SPINDEXER_MOTOR_DIRECTION = InvertedValue.CounterClockwise_Positive; + public static final double SPINDEXER_MOTOR_SPEED = .6; } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index cf42547..15afb32 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -77,7 +77,7 @@ public class RobotContainer { m_driverController.x().onTrue(intakeSubsystem.killSpeedCommand()); m_driverController.a().onTrue(intakeSubsystem.startSpeedCommand()); - m_driverController.b().onTrue(intakeSubsystem.revSpeedCommand()); + //m_driverController.b().onTrue(intakeSubsystem.revSpeedCommand()); intakeSubsystem.setDefaultCommand(new ManualIntake(intakeSubsystem, m_driverController.getHID())); } diff --git a/src/main/java/frc/robot/commands/ManualHopperCommand.java b/src/main/java/frc/robot/commands/ManualHopperCommand.java index ac28df7..e9b4cea 100644 --- a/src/main/java/frc/robot/commands/ManualHopperCommand.java +++ b/src/main/java/frc/robot/commands/ManualHopperCommand.java @@ -23,7 +23,10 @@ public class ManualHopperCommand extends Command { // Called when the command is initially scheduled. @Override public void initialize() { - m_subsystem.spin(Constants.HopperConstants.SPINDEXER_MOTOR_SPEED); + if(m_xboxController.getRightBumper()) + { + m_subsystem.spin(Constants.HopperConstants.SPINDEXER_MOTOR_SPEED); + } } // Called every time the scheduler runs while the command is scheduled. diff --git a/src/main/java/frc/robot/commands/ManualShootCommand.java b/src/main/java/frc/robot/commands/ManualShootCommand.java index 8a23efb..d88a933 100644 --- a/src/main/java/frc/robot/commands/ManualShootCommand.java +++ b/src/main/java/frc/robot/commands/ManualShootCommand.java @@ -6,6 +6,7 @@ package frc.robot.commands; import frc.robot.subsystems.TurretSubsystem; import edu.wpi.first.wpilibj.XboxController; +import edu.wpi.first.wpilibj.GenericHID.RumbleType; import edu.wpi.first.wpilibj2.command.Command; /** An example command that uses an example subsystem. */ @@ -23,14 +24,25 @@ public class ManualShootCommand extends Command { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - if(m_controller.getLeftTriggerAxis()>.5 || m_controller.getRightTriggerAxis()>.5) + if(m_controller.getRightTriggerAxis()>.4) + { + m_subsystem.setLauncher(.6); + m_controller.setRumble(RumbleType.kBothRumble, .33); + } + else if(m_controller.getRightTriggerAxis()>.6) + { + m_subsystem.setLauncher(.8); + m_controller.setRumble(RumbleType.kBothRumble, .67); + } + else if(m_controller.getRightTriggerAxis()>.8) { m_subsystem.setLauncher(1); - System.out.println("Test"); + m_controller.setRumble(RumbleType.kBothRumble, 1); } else { m_subsystem.setLauncher(0); + m_controller.setRumble(RumbleType.kBothRumble, 0); } } diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 26af31d..875f303 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -84,7 +84,7 @@ public class IntakeSubsystem extends TestableSubsystem { public Command startSpeedCommand() { - return this.runOnce(() -> setSpeed(.5)); + return this.runOnce(() -> setSpeed(-.5)); } public Command killSpeedCommand() @@ -94,6 +94,6 @@ public class IntakeSubsystem extends TestableSubsystem { public Command revSpeedCommand() { - return this.runOnce(() -> setSpeed(-.5)); + return this.runOnce(() -> setSpeed(.5)); } } diff --git a/src/main/java/frc/robot/subsystems/TurretSubsystem.java b/src/main/java/frc/robot/subsystems/TurretSubsystem.java index 57f181a..4a70432 100644 --- a/src/main/java/frc/robot/subsystems/TurretSubsystem.java +++ b/src/main/java/frc/robot/subsystems/TurretSubsystem.java @@ -67,21 +67,21 @@ public class TurretSubsystem extends TestableSubsystem { public void startHoming() { //turretMotor.set(Constants.ShooterConstants.HOMING_SPEED); - currentState = TurretState.HOMING; + //currentState = TurretState.HOMING; } public void startRotate(double speed) { - turretGoingPos=speed>0; + /*turretGoingPos=speed>0; if(!passedLimit()) { - //turretMotor.set(speed); + turretMotor.set(speed); } else { - //turretMotor.set(0); - } + turretMotor.set(0); + }*/ } public boolean passedLimit(){ @@ -128,7 +128,5 @@ public class TurretSubsystem extends TestableSubsystem { { //turretMotor.set(0); }*/ - - } }