generated from yeti-robotics/yeti-robot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Intake Feeder Wheel #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d98b662
Prototyped config and IO files
anishb77 38c6062
Prototyped TalonFX and Subsystem
anishb77 93ee518
Updated pascal case and auto logged inputs based on PR, created IO Si…
anishb77 b198409
Combined IO Sim and Talon FX into one
anishb77 e9bb690
Fixed errors in robot container should build now!
anishb77 bfe699f
Added Voltage Out control requests
anishb77 5329c9c
Merge branch 'main' into intakeFeederwheel
samperlmutter 59b7adf
build.gradle and settings.gradle should be reverted now
anishb77 e2fc090
hard coded 0.5 for the rollIn command
anishb77 63ddbf3
Merge branch 'main' into intakeFeederwheel
anishb77 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
5 changes: 5 additions & 0 deletions
5
src/main/java/frc/robot/subsystems/intakeFeederwheel/IntakeFeederwheelConfig.java
This file contains hidden or 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,5 @@ | ||
| package frc.robot.subsystems.intakeFeederwheel; | ||
|
|
||
| public class IntakeFeederwheelConfig { | ||
| static final int FeederwheelMotorID = 20; | ||
| } |
15 changes: 15 additions & 0 deletions
15
src/main/java/frc/robot/subsystems/intakeFeederwheel/IntakeFeederwheelIO.java
This file contains hidden or 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,15 @@ | ||
| package frc.robot.subsystems.intakeFeederwheel; | ||
|
|
||
| import org.littletonrobotics.junction.AutoLog; | ||
|
|
||
| public interface IntakeFeederwheelIO { | ||
| @AutoLog | ||
| public static class IntakeFeederwheelIOInputs { | ||
| public double voltage = 0.0; | ||
| public double RPM = 0.0; | ||
| } | ||
|
|
||
| public default void updateInputs(IntakeFeederwheelIOInputs inputs) {} | ||
|
|
||
| public default void setPower(double power) {} | ||
| } |
24 changes: 24 additions & 0 deletions
24
src/main/java/frc/robot/subsystems/intakeFeederwheel/IntakeFeederwheelSubsystem.java
This file contains hidden or 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,24 @@ | ||
| package frc.robot.subsystems.intakeFeederwheel; | ||
|
|
||
| import edu.wpi.first.wpilibj2.command.Command; | ||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
| import org.littletonrobotics.junction.Logger; | ||
|
|
||
| public class IntakeFeederwheelSubsystem extends SubsystemBase { | ||
| private IntakeFeederwheelIO io; | ||
| private IntakeFeederwheelIOInputsAutoLogged inputs = new IntakeFeederwheelIOInputsAutoLogged(); | ||
|
|
||
| public IntakeFeederwheelSubsystem(IntakeFeederwheelIO io) { | ||
| this.io = io; | ||
| } | ||
|
|
||
| @Override | ||
| public void periodic() { | ||
| io.updateInputs(inputs); | ||
| Logger.processInputs("Intake Feederwheel", inputs); | ||
| } | ||
|
|
||
| public Command rollIn() { | ||
| return runEnd(() -> io.setPower(0.5), () -> io.setPower(0)); | ||
| } | ||
| } |
30 changes: 30 additions & 0 deletions
30
src/main/java/frc/robot/subsystems/intakeFeederwheel/IntakeFeederwheelTalonFX.java
This file contains hidden or 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,30 @@ | ||
| package frc.robot.subsystems.intakeFeederwheel; | ||
|
|
||
| import com.ctre.phoenix6.controls.VoltageOut; | ||
| import com.ctre.phoenix6.hardware.TalonFX; | ||
| import frc.robot.Robot; | ||
| import frc.robot.util.sim.PhysicsSim; | ||
|
|
||
| public class IntakeFeederwheelTalonFX implements IntakeFeederwheelIO { | ||
| private TalonFX feederwheelMotor; | ||
|
|
||
| private final VoltageOut voltageRequest = new VoltageOut(0); | ||
|
|
||
| public IntakeFeederwheelTalonFX() { | ||
| feederwheelMotor = new TalonFX(IntakeFeederwheelConfig.FeederwheelMotorID); | ||
samperlmutter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (Robot.isSimulation()) { | ||
| PhysicsSim.getInstance().addTalonFX(feederwheelMotor); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public void updateInputs(IntakeFeederwheelIOInputs inputs) { | ||
| inputs.voltage = feederwheelMotor.getMotorVoltage().getValueAsDouble(); | ||
| inputs.RPM = feederwheelMotor.getVelocity().getValueAsDouble(); | ||
| } | ||
|
|
||
| @Override | ||
| public void setPower(double volts) { | ||
| feederwheelMotor.setControl(voltageRequest.withOutput(volts)); | ||
| } | ||
| } | ||
This file contains hidden or 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,11 @@ | ||
| package frc.robot.util.sim; | ||
|
|
||
| import edu.wpi.first.epilogue.Logged; | ||
|
|
||
| @Logged | ||
| public class Mechanisms { | ||
|
|
||
| public Mechanisms() {} | ||
|
|
||
| public void publishComponentPoses() {} | ||
| } |
This file contains hidden or 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,9 @@ | ||
| package frc.robot.util.sim; | ||
|
|
||
| import edu.wpi.first.units.measure.Angle; | ||
|
|
||
| public interface SimulatableMechanism { | ||
| Angle getCurrentPosition(); | ||
|
|
||
| Angle getTargetPosition(); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.