Skip to content

Commit

Permalink
added swerve drive shuffleboard values to the UI class
Browse files Browse the repository at this point in the history
ticket: #11
  • Loading branch information
danielbrownmsm committed Jan 4, 2023
1 parent b6f1e0b commit 2088ee6
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
35 changes: 34 additions & 1 deletion src/main/cpp/ui/UserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,37 @@ namespace ShooterUI {
nt::GenericEntry &nt_low_goal = nt_tab.Add("Low Goal Preset", 0).GetEntry();
nt::GenericEntry &nt_far_shot = nt_tab.Add("Far Shot Preset", 0).GetEntry();

} // namespace ShooterUI
} // namespace ShooterUI

namespace SwerveDriveUI {
// Get the tab
frc::ShuffleboardTab &nt_tab = frc::Shuffleboard::GetTab("SwerveDrive");

// Add all the defaults
// Write mode
nt::GenericEntry &nt_write_mode =
nt_tab.Add("Write Mode", false).GetEntry();

// Encoder
nt::GenericEntry &nt_left_ticks = nt_tab.Add("left avg dist", 0).GetEntry();
nt::GenericEntry &nt_right_ticks = nt_tab.Add("right avg dist", 0).GetEntry();
nt::GenericEntry &nt_total_ticks = nt_tab.Add("avg dist", 0).GetEntry();

// Distance PID
nt::GenericEntry &nt_dist_kp = nt_tab.Add("Distance kP", 0).GetEntry();
nt::GenericEntry &nt_dist_ki = nt_tab.Add("Distance kI", 0).GetEntry();
nt::GenericEntry &nt_dist_kd = nt_tab.Add("Distance kD", 0).GetEntry();

// Steer PID
nt::GenericEntry &nt_steer_kp = nt_tab.Add("Steer kP", 0).GetEntry();
nt::GenericEntry &nt_steer_ki = nt_tab.Add("Steer kI", 0).GetEntry();
nt::GenericEntry &nt_steer_kd = nt_tab.Add("Steer kD", 0).GetEntry();

// Gyro
nt::GenericEntry &nt_heading = nt_tab.Add("Heading", 0).GetEntry();
nt::GenericEntry &nt_reset_gyro =
nt_tab.Add("Reset Gyro", false).GetEntry();

// Save parameters button
nt::GenericEntry &nt_save = nt_tab.Add("Save", false).GetEntry();
} // namespace SwerveDriveUI
31 changes: 31 additions & 0 deletions src/main/include/ui/UserInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,34 @@ namespace ShooterUI {
extern nt::GenericEntry &nt_low_goal;
extern nt::GenericEntry &nt_far_shot;
} // namespace ShooterUI

namespace SwerveDriveUI {
// Get the tab
extern frc::ShuffleboardTab &nt_tab;

// Add all the defaults
// Write mode
extern nt::GenericEntry &nt_write_mode;

// Encoder
extern nt::GenericEntry &nt_left_avg;
extern nt::GenericEntry &nt_right_avg;
extern nt::GenericEntry &nt_avg_dist;

// Distance PID
extern nt::GenericEntry &nt_dist_kp;
extern nt::GenericEntry &nt_dist_ki;
extern nt::GenericEntry &nt_dist_kd;

// Steer PID
extern nt::GenericEntry &nt_steer_kp;
extern nt::GenericEntry &nt_steer_ki;
extern nt::GenericEntry &nt_steer_kd;

// Gyro
extern nt::GenericEntry &nt_heading;
extern nt::GenericEntry &nt_reset_gyro;

// Save drivetrain parameters
extern nt::GenericEntry &nt_save;
} // namespace SwerveDriveUI

0 comments on commit 2088ee6

Please sign in to comment.