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

chore: Make a tab variable (DRY) #50

Merged
merged 1 commit into from
Jun 28, 2024
Merged
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
32 changes: 11 additions & 21 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,27 +163,17 @@ public void configureButtonBindings() {

@Override
public void populateDashboard() {
Shuffleboard.getTab("Pit Test");
Shuffleboard.getTab("Pit Test").add("Drive Backward",
drive.moveInDirection(0, -1, 3)).withPosition(1, 2);
Shuffleboard.getTab("Pit Test").add("Drive Left",
drive.moveInDirection(1, 0, 3)).withPosition(0, 1);
Shuffleboard.getTab("Pit Test").add("Drive Right",
drive.moveInDirection(-1, 0, 3)).withPosition(2, 1);
Shuffleboard.getTab("Pit Test").add("Drive Forward",
drive.moveInDirection(0, 1, 3)).withPosition(1, 0);
Shuffleboard.getTab("Pit Test").add("Drive Forward Faster",
drive.moveInDirection(0, 2, 3)).withPosition(4, 1);
Shuffleboard.getTab("Pit Test").add("Stop", drive.moveInDirection(0, 0,
0)).withPosition(1, 1);
Shuffleboard.getTab("Pit Test").add("Foward Right",
drive.moveInDirection(1, -1, 3)).withPosition(2, 0);
Shuffleboard.getTab("Pit Test").add("Foward Left",
drive.moveInDirection(-1, 1, 3)).withPosition(0, 0);
Shuffleboard.getTab("Pit Test").add("Back Right", drive.moveInDirection(1,
1, 3)).withPosition(2, 2);
Shuffleboard.getTab("Pit Test").add("Back Left", drive.moveInDirection(-1,
1, 3)).withPosition(0, 2);
var pitTestTab = Shuffleboard.getTab("Pit Test");
pitTestTab.add("Drive Backward", drive.moveInDirection(0, -1, 3)).withPosition(1, 2);
pitTestTab.add("Drive Left", drive.moveInDirection(1, 0, 3)).withPosition(0, 1);
pitTestTab.add("Drive Right", drive.moveInDirection(-1, 0, 3)).withPosition(2, 1);
pitTestTab.add("Drive Forward", drive.moveInDirection(0, 1, 3)).withPosition(1, 0);
pitTestTab.add("Drive Forward Faster", drive.moveInDirection(0, 2, 3)).withPosition(4, 1);
pitTestTab.add("Stop", drive.moveInDirection(0, 0, 0)).withPosition(1, 1);
pitTestTab.add("Foward Right", drive.moveInDirection(1, -1, 3)).withPosition(2, 0);
pitTestTab.add("Foward Left", drive.moveInDirection(-1, 1, 3)).withPosition(0, 0);
pitTestTab.add("Back Right", drive.moveInDirection(1, 1, 3)).withPosition(2, 2);
pitTestTab.add("Back Left", drive.moveInDirection(-1, 1, 3)).withPosition(0, 2);
Shuffleboard.getTab("AutoBuilder").add("Auto", autoChooser);

}
Expand Down