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

beginnings of FunctionTesting Command #150

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
23 changes: 23 additions & 0 deletions src/main/java/frc/robot/commands/FunctionTestingCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package frc.robot.commands;

import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.constants.ScoringConstants.ScoringLocation;
import frc.robot.subsystems.ScoringElevator.ElevatorSetpoints;

public class FunctionTestingCommand extends SequentialCommandGroup {
public FunctionTestingCommand() {
this.addCommands(
new ScoringElevatorPositionCommand(ElevatorSetpoints.Trap),
new ScoringElevatorPositionCommand(ElevatorSetpoints.Ground),
new AcquireCommand(5),
new TransitionRunCommand(),
new StorageRunCommand(),
new ScoringElevatorPositionCommand(ElevatorSetpoints.Amp),
new ScoreNoteCommand(ScoringLocation.Amp, 2),
new DrawbridgeDownCommand(),
new LiftUpCommand(),
new DrawbridgeUpCommand(),
new LiftDownCommand(),
new ShootPasserCommand(5));
}
}
13 changes: 13 additions & 0 deletions src/main/java/frc/robot/subsystems/Dashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.autons.AutonSelector.AutonChoices;
import frc.robot.commands.FunctionTestingCommand;
import frc.robot.constants.ScoringConstants;

public class Dashboard extends SubsystemBase {
Expand Down Expand Up @@ -49,6 +50,11 @@ public enum Cameras {
.withPosition(0, 0)
.withWidget(BuiltInWidgets.kToggleButton)
.getEntry();
private GenericEntry functionTesting = controlsTab.add("Full Function Testing", false)
.withSize(1, 1)
.withPosition(5, 2)
.withWidget(BuiltInWidgets.kToggleButton)
.getEntry();

// Drivers Tab Inputs
private GenericEntry feedAmpSpeed = driversTab.add("Feed Amp Speed", ScoringConstants.feedAmpSpeed)
Expand Down Expand Up @@ -145,8 +151,15 @@ public void periodic() {
driveTrain.zeroHeading();
resetGyro.setBoolean(false);
}

field.setRobotPose(driveTrain.getPose());
scoring.setFeedAmpSpeed(feedAmpSpeed.getDouble(ScoringConstants.feedAmpSpeed));

if (functionTesting.getBoolean(false)) {
new FunctionTestingCommand();
functionTesting.setBoolean(false);
}

}

/**
Expand Down
Loading