Skip to content
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

Move intake scoring states to separate classes #56

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.SubsystemBase;

import frc.robot.subsystems.intake.enums.IntakeGamepiece;
import frc.robot.subsystems.intake.states.ScoringState;

Expand Down Expand Up @@ -56,7 +57,9 @@ public Command stopIntakeCommand() {
* @param expectedPiece the type of gamepiece to expect when scoring
* @return a command that scores a gamepiece
*/

public Command intakeScoreCommand(ScoringState scoringState, IntakeGamepiece expectedGamepiece) {

SmartDashboard.putString("INTAKE STATE", scoringState.getStateName());

return run(() -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package frc.robot.subsystems.intake.states;


import frc.robot.subsystems.intake.enums.IntakeGamepiece;


public abstract class ScoringState {
double outtakeSpeed;
double cubeOuttakeSpeed;
Expand Down Expand Up @@ -46,9 +48,12 @@ public String getStateName() {
* Gets the outtake speed for the scoring state depending on the gamepiece that is expected to be
* scored
*

* @param expectedGamepiece The gamepiece that is expected to be scored
* @return The outtake speed for the scoring state
*/
public double getOuttakeSpeed(IntakeGamepiece expectedGamepiece) {

if (expectedGamepiece == null) {
return this.outtakeSpeed;
}
Expand Down