2026-01-10 16:52:43 -07:00
|
|
|
package frc4388.robot.subsystems.shooter;
|
|
|
|
|
|
2026-01-27 18:13:51 -07:00
|
|
|
import static edu.wpi.first.units.Units.Degrees;
|
2026-01-10 16:52:43 -07:00
|
|
|
|
|
|
|
|
import com.ctre.phoenix6.configs.CurrentLimitsConfigs;
|
|
|
|
|
import com.ctre.phoenix6.configs.MotorOutputConfigs;
|
|
|
|
|
import com.ctre.phoenix6.configs.TalonFXConfiguration;
|
|
|
|
|
import com.ctre.phoenix6.signals.NeutralModeValue;
|
|
|
|
|
|
|
|
|
|
import edu.wpi.first.units.measure.Angle;
|
2026-01-13 10:08:44 -07:00
|
|
|
import frc4388.utility.status.CanDevice;
|
2026-01-10 16:52:43 -07:00
|
|
|
|
|
|
|
|
public class ShooterConstants {
|
|
|
|
|
// Motor conversions
|
2026-01-13 10:08:44 -07:00
|
|
|
// public static final double ANGLE_MOTOR_GEAR_RATIO = 1.;
|
2026-01-10 16:52:43 -07:00
|
|
|
public static final double PITCH_MOTOR_GEAR_RATIO = 1.;
|
|
|
|
|
public static final double FLYWHEEL_GEAR_RATIO = 1.;
|
|
|
|
|
public static final double FEEDER_INCHES_PER_ROT = 1.;
|
2026-01-27 18:13:51 -07:00
|
|
|
public static final double SHOOTERMOTOR1_GEAR_RATIO = 1.;
|
|
|
|
|
public static final double SHOOTERMOTOR2_GEAR_RATIO = 1.;
|
|
|
|
|
public static final double INDEXER_GEAR_RATIO = 1.;
|
2026-01-10 16:52:43 -07:00
|
|
|
|
|
|
|
|
// Limits
|
|
|
|
|
|
|
|
|
|
// 0 is the forward angle on the robot.
|
|
|
|
|
// negative is left, positive is right
|
2026-01-13 10:08:44 -07:00
|
|
|
// public static final Angle ANGLE_LIMIT_LEFT = Degrees.of(-180);
|
|
|
|
|
// public static final Angle ANGLE_LIMIT_RIGHT = Degrees.of(180);
|
2026-01-10 16:52:43 -07:00
|
|
|
|
|
|
|
|
// 0 is paralell to the ground, 90 is directly up
|
|
|
|
|
public static final Angle PITCH_LIMIT_UPPER = Degrees.of(90);
|
|
|
|
|
public static final Angle PITCH_LIMIT_LOWER = Degrees.of(0);
|
|
|
|
|
|
|
|
|
|
// Motor configs
|
2026-01-13 10:08:44 -07:00
|
|
|
// public static final TalonFXConfiguration ANGLE_MOTOR_CONFIG = new TalonFXConfiguration()
|
|
|
|
|
// .withCurrentLimits(
|
|
|
|
|
// new CurrentLimitsConfigs()
|
|
|
|
|
// .withStatorCurrentLimit(40) // TODO: tune???
|
|
|
|
|
// .withStatorCurrentLimitEnable(true)
|
|
|
|
|
// ).withMotorOutput(
|
|
|
|
|
// new MotorOutputConfigs()
|
|
|
|
|
// .withNeutralMode(NeutralModeValue.Brake) // Must be break because this has to be accurate
|
|
|
|
|
// .withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
public static final class IDs {
|
|
|
|
|
public static final CanDevice FLYWHEEK_CAN_DEVICE = new CanDevice("Flywheel", 22);
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-27 18:13:51 -07:00
|
|
|
public static final TalonFXConfiguration SHOOTER1_MOTOR_CONFIG = new TalonFXConfiguration()
|
2026-01-10 16:52:43 -07:00
|
|
|
.withCurrentLimits(
|
|
|
|
|
new CurrentLimitsConfigs()
|
|
|
|
|
.withStatorCurrentLimit(40) // TODO: tune???
|
|
|
|
|
.withStatorCurrentLimitEnable(true)
|
|
|
|
|
).withMotorOutput(
|
|
|
|
|
new MotorOutputConfigs()
|
|
|
|
|
.withNeutralMode(NeutralModeValue.Brake) // Must be break because this has to be accurate
|
|
|
|
|
.withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means
|
|
|
|
|
);
|
2026-01-27 18:13:51 -07:00
|
|
|
public static final TalonFXConfiguration SHOOTER2_MOTOR_CONFIG = new TalonFXConfiguration()
|
2026-01-10 16:52:43 -07:00
|
|
|
.withCurrentLimits(
|
|
|
|
|
new CurrentLimitsConfigs()
|
|
|
|
|
.withStatorCurrentLimit(40) // TODO: tune???
|
|
|
|
|
.withStatorCurrentLimitEnable(true) // TODO: Figure out what this means
|
|
|
|
|
).withMotorOutput(
|
|
|
|
|
new MotorOutputConfigs()
|
|
|
|
|
.withNeutralMode(NeutralModeValue.Coast) // Must be coast because this is spinny spinny
|
|
|
|
|
.withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means
|
|
|
|
|
);
|
2026-01-27 18:13:51 -07:00
|
|
|
public static final TalonFXConfiguration INDEXER_MOTOR_CONFIG = new TalonFXConfiguration()
|
2026-01-10 16:52:43 -07:00
|
|
|
.withCurrentLimits(
|
|
|
|
|
new CurrentLimitsConfigs()
|
|
|
|
|
.withStatorCurrentLimit(40) // TODO: tune???
|
|
|
|
|
.withStatorCurrentLimitEnable(true)
|
|
|
|
|
).withMotorOutput(
|
|
|
|
|
new MotorOutputConfigs()
|
|
|
|
|
.withNeutralMode(NeutralModeValue.Coast) // Must be coast because this is spinny spinny
|
|
|
|
|
.withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means
|
|
|
|
|
);
|
|
|
|
|
}
|