This commit is contained in:
TheRealGrayden 2026-03-12 19:15:44 -04:00
parent 7bce2b2a00
commit c54efe42a5
5 changed files with 27 additions and 21 deletions

View File

@ -68,10 +68,10 @@ public final class Constants {
} }
public static class IntakeConstants { public static class IntakeConstants {
public static final int DEPLOY_MOTOR_ID = 12; public static final int DEPLOY_MOTOR_ID = 17;
public static final boolean DEPLOY_MOTOR_INVERTED = true; // TODO: Test this public static final boolean DEPLOY_MOTOR_INVERTED = false; // TODO: Test this
public static final int INTAKE_MOTOR_ID = 1; public static final int INTAKE_MOTOR_ID = 0;
public static final InvertedValue INTAKE_MOTOR_DIRECTION = InvertedValue.Clockwise_Positive; // TODO: Test this public static final InvertedValue INTAKE_MOTOR_DIRECTION = InvertedValue.Clockwise_Positive; // TODO: Test this
} }
@ -79,31 +79,31 @@ public final class Constants {
public static final int LAUNCHER_MOTOR_ID = 2; public static final int LAUNCHER_MOTOR_ID = 2;
public static final boolean LAUNCHER_MOTOR_INVERTED = true; // TODO: Test this public static final boolean LAUNCHER_MOTOR_INVERTED = true; // TODO: Test this
public static final int TURRET_MOTOR_ID = 1; public static final int TURRET_MOTOR_ID = 0;
public static final InvertedValue TURRET_MOTOR_DIRECTION = InvertedValue.CounterClockwise_Positive; public static final InvertedValue TURRET_MOTOR_DIRECTION = InvertedValue.CounterClockwise_Positive;
public static final int TURRET_LIMIT_CHANNEL = 0; public static final int TURRET_LIMIT_CHANNEL = 0;
public static final Angle LIMIT_AXIMUTH_POS = edu.wpi.first.units.Units.Degrees.of(265); public static final Angle LIMIT_AXIMUTH_POS = edu.wpi.first.units.Units.Degrees.of(265);
public static final Angle LIMIT_AXIMUTH_NEG = edu.wpi.first.units.Units.Degrees.of(5); public static final Angle LIMIT_AXIMUTH_NEG = edu.wpi.first.units.Units.Degrees.of(5);
public static final double HOMING_SPEED = .35; public static final double HOMING_SPEED = .35;
public static final double TURRET_GEAR_RATIO = 1; public static final double TURRET_GEAR_RATIO = 0;
public static final int HOOD_SERVO_CHANNEL = 3; public static final int HOOD_SERVO_CHANNEL = 0;
public static final boolean HOOD_SERVO_INVERTED = true; // TODO: Test this public static final boolean HOOD_SERVO_INVERTED = true; // TODO: Test this
public static final int HOOD_ENCODER_ID = 4; public static final int HOOD_ENCODER_ID = 0;
public static final Angle TARGET_ELEVATION_DIF = edu.wpi.first.units.Units.Degrees.of(1); public static final Angle TARGET_ELEVATION_DIF = edu.wpi.first.units.Units.Degrees.of(10000);
public static final Angle LIMIT_ELEVATION_POS = edu.wpi.first.units.Units.Degrees.of(90); public static final Angle LIMIT_ELEVATION_POS = edu.wpi.first.units.Units.Degrees.of(0);
public static final Angle LIMIT_ELEVATION_NEG = edu.wpi.first.units.Units.Degrees.of(0); public static final Angle LIMIT_ELEVATION_NEG = edu.wpi.first.units.Units.Degrees.of(0);
public static final Angle DEFLECTOR_STORED_ANGLE = edu.wpi.first.units.Units.Degrees.of(0); public static final Angle DEFLECTOR_STORED_ANGLE = edu.wpi.first.units.Units.Degrees.of(0);
public static final Angle DEFLECTOR_SET_ANGLE1 = edu.wpi.first.units.Units.Degrees.of(20); public static final Angle DEFLECTOR_SET_ANGLE1 = edu.wpi.first.units.Units.Degrees.of(0);
public static final Angle DEFLECTOR_SET_ANGLE2 = edu.wpi.first.units.Units.Degrees.of(40); public static final Angle DEFLECTOR_SET_ANGLE2 = edu.wpi.first.units.Units.Degrees.of(0);
public static final Angle DEFLECTOR_SET_ANGLE3 = edu.wpi.first.units.Units.Degrees.of(60); public static final Angle DEFLECTOR_SET_ANGLE3 = edu.wpi.first.units.Units.Degrees.of(0);
} }
public static class HopperConstants { public static class HopperConstants {
public static final int KICKER_MOTOR_ID = 0; 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.CounterClockwise_Positive;
public static final int SPINDEXER_MOTOR_ID = 1; public static final int SPINDEXER_MOTOR_ID = 8;
public static final InvertedValue SPINDEXER_MOTOR_DIRECTION = InvertedValue.Clockwise_Positive; public static final InvertedValue SPINDEXER_MOTOR_DIRECTION = InvertedValue.Clockwise_Positive;
} }
} }

View File

@ -65,12 +65,14 @@ public class RobotContainer {
turretSubsystem.setDefaultCommand(new ManualShootCommand(turretSubsystem, m_driverController.getHID())); turretSubsystem.setDefaultCommand(new ManualShootCommand(turretSubsystem, m_driverController.getHID()));
hopperSubsystem.setDefaultCommand(new ManualHopperCommand(hopperSubsystem, m_driverController.getHID())); hopperSubsystem.setDefaultCommand(new ManualHopperCommand(hopperSubsystem, m_driverController.getHID()));
m_driverController.povDown().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_STORED_ANGLE)); //The shooter will tear its self apart if deflector moves, so dont move it
/*m_driverController.povDown().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_STORED_ANGLE));
m_driverController.povLeft().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE1)); m_driverController.povLeft().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE1));
m_driverController.povRight().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE3)); m_driverController.povRight().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE3));
m_driverController.povUp().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE2)); m_driverController.povUp().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE2));
/*m_driverController.y().onTrue(intakeSubsystem.deployCommand()); m_driverController.y().onTrue(intakeSubsystem.deployCommand());
m_driverController.a().onTrue(intakeSubsystem.retractCommand()); m_driverController.a().onTrue(intakeSubsystem.retractCommand());
m_driverController.b().onTrue(intakeSubsystem.reverseCommand());*/ m_driverController.b().onTrue(intakeSubsystem.reverseCommand());*/

View File

@ -22,7 +22,7 @@ public class ManualHopperCommand extends Command {
// Called when the command is initially scheduled. // Called when the command is initially scheduled.
@Override @Override
public void initialize() { public void initialize() {
m_subsystem.spin(.5); m_subsystem.spin(0);
} }
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.

View File

@ -8,9 +8,11 @@ import frc.robot.subsystems.TurretSubsystem;
import edu.wpi.first.units.measure.Angle; import edu.wpi.first.units.measure.Angle;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
//The Turret does NOT move, hood does NOT move, it will die
/** An example command that uses an example subsystem. **/ /** An example command that uses an example subsystem. **/
public class SetDeflectorCommand extends Command { public class SetDeflectorCommand extends Command {
private final TurretSubsystem m_subsystem; /*private final TurretSubsystem m_subsystem;
private Angle deployAngle; private Angle deployAngle;
public SetDeflectorCommand(TurretSubsystem subsystem, Angle deployAngle) { public SetDeflectorCommand(TurretSubsystem subsystem, Angle deployAngle) {
@ -28,5 +30,5 @@ public class SetDeflectorCommand extends Command {
@Override @Override
public boolean isFinished() { public boolean isFinished() {
return true; return true;
} }*/
} }

View File

@ -126,7 +126,9 @@ public class TurretSubsystem extends TestableSubsystem {
private void periodicManual() private void periodicManual()
{ {
if(passedLimit()) //If the hood or turret move, it will be a uh-oh, so DONT MOVE THEM
/*if(passedLimit())
{ {
//turretMotor.set(0); //turretMotor.set(0);
} }
@ -151,6 +153,6 @@ public class TurretSubsystem extends TestableSubsystem {
else else
{ {
hood.set(0); hood.set(0);
} }*/
} }
} }