Skip to content

Commit

Permalink
Added updateInputs method
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekChen1 committed Dec 1, 2023
1 parent 0de89c7 commit a1e9190
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/main/java/frc/robot/subsystems/IntakeIOTalonFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
import frc.robot.subsystems.IntakeIO.IntakeIOInputs;

public class IntakeIOTalonFX extends SubsystemBase {
private TalonFX intakeMotor;
private ShuffleboardTab shuffleboard = Shuffleboard.getTab("Intake Subsystem");
private IntakeSubsystem intakeSubsystem;
private LinearFilter filter;
private double filterOutput;
private boolean isCone;
// private final TimeOfFlight coneToF, cubeToF;

/** Creates a new IntakeIOTalonFX. */
public IntakeIOTalonFX() {
public IntakeIOTalonFX(IntakeSubsystem intakeSubsystem) {
this.intakeSubsystem = intakeSubsystem;

intakeMotor = new TalonFX(Constants.Intake.Ports.INTAKE_MOTOR_PORT);

intakeMotor.configFactoryDefault();
Expand Down Expand Up @@ -59,5 +63,10 @@ public double getFilterOutput() {
return filterOutput;
}

public void updateInputs(IntakeIO inputs) {}
public void updateInputs(IntakeIOInputs inputs) {
inputs.currentIntakeMode = intakeSubsystem.getMode().toString();
inputs.filterOutput = getFilterOutput();
inputs.isCone = getIsCone();
inputs.motorOutput = getMotorPower();
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/IntakeSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class IntakeSubsystem extends SubsystemBase {
private final IntakeIO io;
private final IntakeIOInputs inputs = new IntakeIOInputs();
private final IntakeIOTalonFX motorIO = new IntakeIOTalonFX();
private final IntakeIOTalonFX motorIO = new IntakeIOTalonFX(this);
private Modes mode;
private ShuffleboardTab shuffleboard = Shuffleboard.getTab("Intake Subsystem");

Expand Down

0 comments on commit a1e9190

Please sign in to comment.