Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
minhnguyenbhs committed Oct 9, 2024
1 parent 67f8485 commit 759e657
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/main/java/frc/robot/BuildConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ public final class BuildConstants {
public static final String MAVEN_GROUP = "";
public static final String MAVEN_NAME = "high-key-2024-2";
public static final String VERSION = "unspecified";
public static final int GIT_REVISION = 20;
public static final String GIT_SHA = "60857c99f27fe0d7e277b51b2878d3550123a1a8";
public static final String GIT_DATE = "2024-10-02 18:10:46 EDT";
public static final int GIT_REVISION = 21;
public static final String GIT_SHA = "6f294fbe0f63115f6c9e4f57d2a2ec855bb55efa";
public static final String GIT_DATE = "2024-10-02 18:42:46 EDT";
public static final String GIT_BRANCH = "shooter-hardware";
public static final String BUILD_DATE = "2024-10-02 18:25:06 EDT";
public static final long BUILD_UNIX_TIME = 1727907906440L;
public static final String BUILD_DATE = "2024-10-02 18:45:16 EDT";
public static final long BUILD_UNIX_TIME = 1727909116112L;
public static final int DIRTY = 1;

private BuildConstants() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.motorcontrol.Spark;
import com.revrobotics.CANSparkFlex;
import com.revrobotics.SparkLimitSwitch;
import com.revrobotics.CANSparkLowLevel.MotorType;

import com.revrobotics.SparkLimitSwitch;
import frc.robot.constants.IntakeConstants;
import frc.robot.constants.SensorConstants;
import frc.robot.constants.IntakeConstants;
Expand Down
21 changes: 9 additions & 12 deletions src/main/java/frc/robot/subsystems/scoring/ShooterIOTalonFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
import com.ctre.phoenix6.controls.VelocityDutyCycle;
import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.signals.NeutralModeValue;
import com.revrobotics.CANSparkFlex;
import com.revrobotics.CANSparkLowLevel.MotorType;
import com.revrobotics.SparkLimitSwitch;
import frc.robot.constants.ConversionConstants;
import frc.robot.constants.ScoringConstants;

public class ShooterIOTalonFX implements ShooterIO {
private final TalonFX kicker = new TalonFX(ScoringConstants.kickerMotorId);
private final CANSparkFlex kicker =
new CANSparkFlex(ScoringConstants.kickerMotorId, MotorType.kBrushless);

private final TalonFX shooterLeft = new TalonFX(ScoringConstants.shooterLeftMotorId);
private final TalonFX shooterRight = new TalonFX(ScoringConstants.shooterRightMotorId);

private final Slot0Configs slot0 = new Slot0Configs();

/// DigitalInput bannerSensor = new DigitalInput(SensorConstants.indexerSensorPort);

private boolean override = false;
private double overrideVolts = 0.0;

Expand Down Expand Up @@ -48,12 +50,6 @@ public ShooterIOTalonFX() {
.withStatorCurrentLimit(ScoringConstants.shooterCurrentLimit)
.withStatorCurrentLimitEnable(true));

TalonFXConfigurator kickerConfig = kicker.getConfigurator();
kickerConfig.apply(
new CurrentLimitsConfigs()
.withStatorCurrentLimit(ScoringConstants.kickerCurrentLimit)
.withStatorCurrentLimitEnable(true));

slot0.withKP(ScoringConstants.shooterkP);
slot0.withKI(ScoringConstants.shooterkI);
slot0.withKD(ScoringConstants.shooterkD);
Expand Down Expand Up @@ -124,10 +120,11 @@ public void updateInputs(ShooterInputs inputs) {
inputs.shooterRightStatorCurrentAmps = shooterRight.getStatorCurrent().getValueAsDouble();
inputs.shooterRightSupplyCurrentAmps = shooterRight.getSupplyCurrent().getValueAsDouble();

inputs.kickerAppliedVolts = kicker.getMotorVoltage().getValueAsDouble();
inputs.kickerStatorCurrentAmps = kicker.getStatorCurrent().getValueAsDouble();
inputs.kickerAppliedVolts = kicker.getBusVoltage();
inputs.kickerStatorCurrentAmps = kicker.getOutputCurrent();

inputs.bannerSensor = true; // !bannerSensor.get();
inputs.bannerSensor =
kicker.getForwardLimitSwitch(SparkLimitSwitch.Type.kNormallyOpen).isPressed();
}

@Override
Expand Down

0 comments on commit 759e657

Please sign in to comment.