import frc.robot.commands.drive_comm.DefaultDriveCommand;
import frc.robot.commands.gpm.AutoShootCommand;
import frc.robot.commands.gpm.ClimbDriveCommand;
-// import frc.robot.commands.gpm.HardstopWarning;
import frc.robot.commands.gpm.IntakeMovementCommand;
import frc.robot.commands.gpm.RunSpindexer;
import frc.robot.commands.gpm.Superstructure;
hood = new Hood();
case TwinBot:
- spindexer = new Spindexer();
- intake = new Intake();
+ break;
case SwerveCompetition: // AKA "Vantage"
import frc.robot.subsystems.Intake.Intake;
import frc.robot.subsystems.hood.Hood;
import frc.robot.subsystems.hood.HoodConstants;
-import frc.robot.subsystems.turret.Turret;
public class HardstopWarning extends Command {
private Hood hood;
private Intake intake;
- private Turret turret;
- private String turretStatus;
- public HardstopWarning(Hood hood, Intake intake, Turret turret) {
+ public HardstopWarning(Hood hood, Intake intake) {
this.hood = hood;
this.intake = intake;
- this.turret = turret;
- turretStatus = "Unknown";
}
@Override
double epsilon = 0.05;
SmartDashboard.putBoolean("Hood OK", hood.getPositionDeg() >= HoodConstants.MIN_ANGLE - epsilon);
SmartDashboard.putBoolean("Intake OK", intake.getPosition() >= IntakeConstants.STARTING_POINT - epsilon);
-
- // if (Math.abs(turret.getPositionRad()) <= epsilon) {
- // var encoderPositions = turret.getEncoderPositions();
- // if (Math.abs(encoderPositions.getFirst()) <= epsilon && Math.abs(encoderPositions.getSecond()) <= epsilon)
- // turretStatus = "Ok";
- // else
- // turretStatus = "Bad";
- // }
-
- SmartDashboard.putString("Turret Status", turretStatus);
}
@Override
this.turret = turret;
this.hood = hood;
- addRequirements(spindexer, hood);
+ addRequirements(spindexer);
}
// public RunSpindexer(Spindexer spindexer) {
}
// Spindexer
- if (spindexer != null) {
+ if (spindexer != null && turret != null && hood != null) {
// Toggle spindexer
controller.get(PS5Button.LEFT_TRIGGER).toggleOnTrue(
leftMotor.getConfigurator().apply(config);
leftMotor.getConfigurator().apply(
- new MotorOutputConfigs().withInverted(InvertedValue.Clockwise_Positive)
+ new MotorOutputConfigs().withInverted(InvertedValue.CounterClockwise_Positive)
.withNeutralMode(NeutralModeValue.Coast)
);
* @param setpoint in inches
*/
public void setPosition(double setpoint) {
- double motorRotations = -inchesToRotations(setpoint);
+ double motorRotations = inchesToRotations(setpoint);
rightMotor.setControl(voltageRequest.withPosition(motorRotations));
leftMotor.setControl(voltageRequest.withPosition(motorRotations));