diff --git a/src/main/cpp/RobotContainer.cpp b/src/main/cpp/RobotContainer.cpp index d9a4b9c..f3c987e 100644 --- a/src/main/cpp/RobotContainer.cpp +++ b/src/main/cpp/RobotContainer.cpp @@ -17,6 +17,8 @@ #include #include +#include + #include "commands/AimCommand.h" #include "commands/AimShootCommand.h" #include "commands/SimpleDriveCommand.h" @@ -68,6 +70,7 @@ RobotContainer::RobotContainer () { frc2::CommandScheduler::GetInstance().RegisterSubsystem(m_PowerCellCounter); InitAutonomousChooser(); + // Remember to put this in the driver table later? frc::SmartDashboard::PutData("Auto Modes", &m_DashboardAutoChooser); // Configure the button bindings @@ -343,5 +346,6 @@ void RobotContainer::ReportSelectedAuto () { name = m_DashboardAutoChooser.GetDefaultName(); } - frc::SmartDashboard::PutString("Robot sees autonomous", name); + auto drivetable = nt::NetworkTableInstance::GetDefault().GetTable(NetTabs::DriveTeamTable); + drivetable->PutString("Robot Sees AutoMode:", name); } diff --git a/src/main/cpp/subsystems/Climb.cpp b/src/main/cpp/subsystems/Climb.cpp index 55e4d1d..a05cf5e 100644 --- a/src/main/cpp/subsystems/Climb.cpp +++ b/src/main/cpp/subsystems/Climb.cpp @@ -2,6 +2,7 @@ #include #include +#include #include @@ -11,7 +12,9 @@ Climb::Climb () {} void Climb::Periodic () { - frc::SmartDashboard::PutBoolean("Winch Locked", m_IsWinchLocked); + auto drivetable = nt::NetworkTableInstance::GetDefault().GetTable(NetTabs::DriveTeamTable); + drivetable->PutBoolean("Winch Locked", m_IsWinchLocked); + drivetable->PutBoolean("Climb Piston Extended", m_IsPistonExtended); } void Climb::PistonExtend () { diff --git a/src/main/cpp/subsystems/Shooter.cpp b/src/main/cpp/subsystems/Shooter.cpp index 1c59966..9e06fdb 100644 --- a/src/main/cpp/subsystems/Shooter.cpp +++ b/src/main/cpp/subsystems/Shooter.cpp @@ -169,6 +169,8 @@ void Shooter::SetLimelightLight (bool on) { } void Shooter::TrackingPeriodic (TrackingMode mode) { + auto drivetable = nt::NetworkTableInstance::GetDefault().GetTable(NetTabs::DriveTeamTable); + if (mode == TrackingMode::CameraTracking) { double speed = 0; @@ -176,7 +178,7 @@ void Shooter::TrackingPeriodic (TrackingMode mode) { if (m_TargetCount > 0) { std::cout << "Count: " << m_TargetCount << std::endl; - frc::SmartDashboard::PutBoolean("Limelight Has Target", true); + drivetable->PutBoolean("Limelight Has Target", true); m_TargetErrorX = -m_VisionTable->GetNumber("tx", 0); m_TargetErrorY = -m_VisionTable->GetNumber("ty", 0); @@ -189,15 +191,15 @@ void Shooter::TrackingPeriodic (TrackingMode mode) { speed = m_TurretPID->Calculate(m_TargetErrorX); } else if (m_TargetCount == 0) { std::cout << "No objects detected" << std::endl; - frc::SmartDashboard::PutBoolean("Limelight Has Target", false); + drivetable->PutBoolean("Limelight Has Target", false); } else { std::cout << "Variable tv does not exist in table limelight-gears" << std::endl; - frc::SmartDashboard::PutBoolean("Limelight Has Target", false); + drivetable->PutBoolean("Limelight Has Target", false); } SetTurretSpeed(speed); } else { - frc::SmartDashboard::PutBoolean("Limelight Has Target", false); + drivetable->PutBoolean("Limelight Has Target", false); SetLimelightLight(false); return; } diff --git a/src/main/include/Constants.h b/src/main/include/Constants.h index 9052628..9def665 100644 --- a/src/main/include/Constants.h +++ b/src/main/include/Constants.h @@ -1,5 +1,9 @@ #pragma once +namespace NetTabs { + const std::string DriveTeamTable = "Driving"; +} + namespace ConfigFiles { const std::string ConfigFile = "config.toml"; const std::string AutoConfigFile = "auto.toml";