Skip to content

Commit

Permalink
NarDash changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mason-Lam committed Nov 28, 2023
1 parent db52733 commit 5661b59
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 382 deletions.
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ def ROBOT_MAIN_CLASS = "frc.team3128.Main"

// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project DeployUtils.
repositories {
maven {
url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit")
credentials {
username = "Mechanical-Advantage-Bot"
password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051"
}
}
}

deploy {
targets {
roborio(getTargetTypeClass('RoboRIO')) {
Expand Down
17 changes: 10 additions & 7 deletions src/main/java/frc/team3128/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
import frc.team3128.commands.CmdSwerveDrive;
import frc.team3128.PositionConstants.Position;
import static frc.team3128.commands.CmdManager.*;

import common.utility.narwhaldashboard.NarwhalDashboard;
import frc.team3128.common.hardware.input.NAR_ButtonBoard;
import frc.team3128.common.hardware.input.NAR_Joystick;
import frc.team3128.common.hardware.input.NAR_XboxController;
import frc.team3128.common.narwhaldashboard.NarwhalDashboard;
import frc.team3128.common.utility.NAR_Shuffleboard;
import frc.team3128.subsystems.Swerve;
import frc.team3128.subsystems.Vision;
Expand All @@ -34,6 +35,8 @@ public class RobotContainer {

public static NAR_XboxController controller;

private NarwhalDashboard dashboard;

public RobotContainer() {

swerve = Swerve.getInstance();
Expand Down Expand Up @@ -180,15 +183,15 @@ private void initDashboard() {
swerve.initShuffleboard();
Vision.getInstance().initShuffleboard();

NarwhalDashboard.startServer();
dashboard = NarwhalDashboard.getInstance();
dashboard.addUpdate("time", ()-> Timer.getMatchTime());
dashboard.addUpdate("voltage",()-> RobotController.getBatteryVoltage());
dashboard.addUpdate("x", ()-> swerve.getPose().getX());
dashboard.addUpdate("y", ()-> swerve.getPose().getY());
}

public void updateDashboard() {
NarwhalDashboard.put("time", Timer.getMatchTime());
NarwhalDashboard.put("voltage", RobotController.getBatteryVoltage());
NarwhalDashboard.put("x", swerve.getPose().getX());
NarwhalDashboard.put("y", swerve.getPose().getY());

dashboard.update();
if (DriverStation.getMatchType() == MatchType.None) {
NAR_Shuffleboard.update();
}
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/frc/team3128/autonomous/AutoPrograms.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
import static edu.wpi.first.wpilibj2.command.Commands.*;
import frc.team3128.PositionConstants.Position;
import frc.team3128.commands.CmdAutoBalance;
import frc.team3128.common.narwhaldashboard.NarwhalDashboard;
import static frc.team3128.commands.CmdManager.*;

import common.utility.narwhaldashboard.NarwhalDashboard;

/**
* Class to store information about autonomous routines.
* @author Daniel Wang, Mason Lam
Expand All @@ -34,11 +35,12 @@ private void initAutoSelector() {

"scuffedClimb"
};
NarwhalDashboard.addAutos(autoStrings);
NarwhalDashboard.getInstance().addAutos(autoStrings);
}

public Command getAutonomousCommand() {
String selectedAutoName = NarwhalDashboard.getSelectedAutoName();
// String selectedAutoName = NarwhalDashboard.getInstance().selectedAutoName;
String selectedAutoName = null;
final Command autoCommand;

if (selectedAutoName == null) {
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5661b59

Please sign in to comment.