-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package frc.robot.subsystems.indexer; | ||
|
||
public class Indexer extends SubsystemBase { | ||
private IndexerIOInputs io | ||
private IndexerIOInputsAutoLogged inputs = new IndexerIOInputsAutoLogged(); | ||
|
||
public Indexer(IndexerIOInputs io) { | ||
this.io = io; | ||
} | ||
|
||
public setIndexerSpeed(double speed) { | ||
io.setSpeed(speed); | ||
Logger.recordOutput("Indexer", speed); | ||
} | ||
|
||
public stop() { | ||
io.stop(); | ||
} | ||
|
||
@Override | ||
public void periodic() { | ||
io.updateInputs(inputs); | ||
Logger.processInputs("Indexer", inputs); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/frc/robot/subsystems/indexer/IndexerConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package frc.robot.subsystems.indexer; | ||
|
||
public final class IndexerConstants {} |
28 changes: 28 additions & 0 deletions
28
src/main/java/frc/robot/subsystems/indexer/IndexerIOSim.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package frc.robot.subsystems.indexer; | ||
|
||
public class IndexerIOSim implements IndexerIO { | ||
private final DCMotorSim indexerSim = new DCMotor(null, 0, 0); | ||
|
||
private double indexerAppliedVolts = 0.0; | ||
|
||
public IndexerIO() { | ||
indexerSim.update(0.02); | ||
|
||
inputs.isConnected = true; | ||
|
||
inputs.indexerVelocity = intakeSim.getVelocityRadPerSec() / (Math.PI * 2); | ||
inputs.indexerStatorCurrentAmps = intakeSim.getCurrentDrawAmps(); | ||
inputs.indexerAppliedVolts = intakeAppliedVolts; | ||
} | ||
|
||
@Override | ||
public void setIndexerSpeed(double speed) { | ||
indexerSim.setInputVoltage(speed); | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
indexerSim.setInputVoltage(0); | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/frc/robot/subsystems/intake/IntakeConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package frc.robot.subsystems.intake; | ||
|
||
public final class IntakeConstants {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters