+++ /dev/null
-package frc.robot;
-
-public class ClimbCommand {
-
-}
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.spindexer.Spindexer;
-import frc.robot.subsystems.turret.Turret;
public class RunSpindexer extends Command {
private Spindexer spindexer;
- private Turret turret;
- public RunSpindexer(Spindexer spindexer, Turret turret){
+ public RunSpindexer(Spindexer spindexer){
this.spindexer = spindexer;
- this.turret = turret;
addRequirements(spindexer);
}
@Override
public void execute() {
- //if (turret.atSetpoint()){
- spindexer.maxSpindexer();
- // } else{
- // spindexer.stopSpindexer();
- // }
+ spindexer.maxSpindexer();
}
@Override
goalState = ShooterPhysics.getShotParams(
Translation2d.kZero,
target3d.minus(lookahead3d),
- target == FieldConstants.getHubTranslation().toTranslation2d() ?
- 2.0 : 2.0);
+ 2.0);
double TOFAdjustment = 0.85;
timeOfFlight = goalState.timeOfFlight() * TOFAdjustment;
* @return Whether Y coordinate is in the upper half (left side on blue alliance)
*/
public static boolean isOnLeftSideOfField(Translation2d drivepose){
- if (drivepose.getY() > FIELD_WIDTH/2){
- return true;
- }
- return false;
+ return drivepose.getY() > FIELD_WIDTH/2;
}
public static Translation3d getOppositionTranslation(boolean sideLeft) {
}
}, intake));
- // Retract if hold for 3 seconds
+ // Retract if hold for 2 seconds
controller.get(PS5Button.RIGHT_TRIGGER).debounce(2.0).onTrue(new InstantCommand(() -> {
intake.retract();
intakeBoolean = true;
// Spindexer
if (spindexer != null) {
// Will only run if we are not calling default shoot command
- controller.get(PS5Button.LEFT_TRIGGER).whileTrue(new RunSpindexer(spindexer, turret));
+ controller.get(PS5Button.LEFT_TRIGGER).whileTrue(new RunSpindexer(spindexer));
}
// Auto shoot
* @param setpoint in rotations
*/
public void setSetpoint(double setpoint) {
- TalonFXConfiguration config = new TalonFXConfiguration();
- config.MotorOutput.Inverted = InvertedValue.Clockwise_Positive;
- motor.getConfigurator().apply(config);
pid.setSetpoint(setpoint);
}
* @param setpoint in inches
*/
public void setPosition(double setpoint) {
- leftMotor.getConfigurator().apply(
- new MotorOutputConfigs().withInverted(InvertedValue.Clockwise_Positive)
- .withNeutralMode(NeutralModeValue.Coast)
- );
-
- rightMotor.getConfigurator().apply(
- new MotorOutputConfigs().withNeutralMode(NeutralModeValue.Coast)
- );
-
double motorRotations = inchesToRotations(setpoint);
rightMotor.setControl(voltageRequest.withPosition(motorRotations));
leftMotor.setControl(voltageRequest.withPosition(motorRotations));