From 9e6efc92c3e66af3e56af706a71e3c5be48671fc Mon Sep 17 00:00:00 2001 From: Drew Williams Date: Tue, 29 Oct 2024 12:36:29 -0400 Subject: [PATCH] added wheel radius buttons to dashboard --- src/main/cpp/RobotContainer.cpp | 10 ++++++---- src/main/include/RobotContainer.h | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/cpp/RobotContainer.cpp b/src/main/cpp/RobotContainer.cpp index 920dd57..0aadf15 100644 --- a/src/main/cpp/RobotContainer.cpp +++ b/src/main/cpp/RobotContainer.cpp @@ -86,10 +86,12 @@ void RobotContainer::ConfigureBindings() { // driverController.POVRight().OnTrue(swerveSubsystem.TunePosePID([this] { return // driverController.Start().Get(); })); - // controller.Back().WhileTrue( - // swerveSubsystem.WheelRadius(frc2::sysid::Direction::kReverse)); - // controller.Start().WhileTrue( - // swerveSubsystem.WheelRadius(frc2::sysid::Direction::kForward)); + tuningTable->PutBoolean("WheelRadiusFwd", false); + tuningTable->PutBoolean("WheelRadiusRev", false); + + + wheelRadFwdBtn.WhileTrue(swerveSubsystem.WheelRadius(frc2::sysid::Direction::kForward)); + wheelRadRevBtn.WhileTrue(swerveSubsystem.WheelRadius(frc2::sysid::Direction::kReverse)); operatorController.A().WhileTrue(shooterSubsystem.RunShooter( [] { return consts::shooter::PRESET_SPEEDS::AMP; })); diff --git a/src/main/include/RobotContainer.h b/src/main/include/RobotContainer.h index 3162471..adb12ab 100644 --- a/src/main/include/RobotContainer.h +++ b/src/main/include/RobotContainer.h @@ -7,6 +7,7 @@ #include //#include #include +#include #include @@ -38,6 +39,11 @@ class RobotContainer { frc2::CommandXboxController operatorController{1}; //frc2::CommandLogitechController sylaceController{2}; + std::shared_ptr tuningTable{nt::NetworkTableInstance::GetDefault().GetTable("Tuning")}; + + frc2::NetworkButton wheelRadFwdBtn{tuningTable, "WheelRadiusFwd"}; + frc2::NetworkButton wheelRadRevBtn{tuningTable, "WheelRadiusRev"}; + frc2::CommandPtr RumbleDriver(std::function timeToRumble); frc2::CommandPtr RumbleOperator( std::function timeToRumble);