diff --git a/src/main/cpp/RobotContainer.cpp b/src/main/cpp/RobotContainer.cpp index 0ebab98..20a1334 100644 --- a/src/main/cpp/RobotContainer.cpp +++ b/src/main/cpp/RobotContainer.cpp @@ -83,6 +83,9 @@ void RobotContainer::ConfigureBindings() { operatorController.B().OnFalse(shooterSubsystem.RunShooter( [] { return consts::shooter::PRESET_SPEEDS::OFF; })); + operatorController.Start().WhileTrue(shooterSubsystem.RunShooter([] { return consts::shooter::PRESET_SPEEDS::TUNING; })); + operatorController.Start().OnFalse(shooterSubsystem.RunShooter([] { return consts::shooter::PRESET_SPEEDS::OFF; })); + operatorController.Back().WhileTrue( frc2::cmd::Parallel(intakeSubsystem.PoopNote(), feederSubsystem.Eject())); diff --git a/src/main/cpp/subsystems/ShooterSubsystem.cpp b/src/main/cpp/subsystems/ShooterSubsystem.cpp index d93d1a3..30d8af2 100644 --- a/src/main/cpp/subsystems/ShooterSubsystem.cpp +++ b/src/main/cpp/subsystems/ShooterSubsystem.cpp @@ -62,6 +62,11 @@ frc2::CommandPtr ShooterSubsystem::RunShooter( consts::shooter::BOTTOM_SHOOTER_LUT[distance()]; neutralState = false; break; + case consts::shooter::PRESET_SPEEDS::TUNING: + topWheelVelocitySetpoint = units::revolutions_per_minute_t{topWheelTuningSetpoint.Get()}; + bottomWheelVelocitySetpoint = units::revolutions_per_minute_t{bottomWheelTuningSetpoint.Get()}; + neutralState = false; + break; case consts::shooter::PRESET_SPEEDS::OFF: topWheelVelocitySetpoint = 0_rpm; bottomWheelVelocitySetpoint = 0_rpm; diff --git a/src/main/deploy/commit.txt b/src/main/deploy/commit.txt index f499977..b87c34e 100644 --- a/src/main/deploy/commit.txt +++ b/src/main/deploy/commit.txt @@ -1 +1 @@ -aefe2b0 \ No newline at end of file +1f880d6 \ No newline at end of file diff --git a/src/main/include/constants/ShooterConstants.h b/src/main/include/constants/ShooterConstants.h index 7e2cfe7..03df2cc 100644 --- a/src/main/include/constants/ShooterConstants.h +++ b/src/main/include/constants/ShooterConstants.h @@ -69,6 +69,6 @@ inline static wpi::interpolating_map inline static wpi::interpolating_map BOTTOM_SHOOTER_LUT{}; -enum class PRESET_SPEEDS { OFF, AMP, SPEAKER_DIST, SUBWOOFER, PASS }; +enum class PRESET_SPEEDS { OFF, AMP, SPEAKER_DIST, SUBWOOFER, PASS, TUNING }; } // namespace shooter } // namespace consts diff --git a/src/main/include/subsystems/ShooterSubsystem.h b/src/main/include/subsystems/ShooterSubsystem.h index 2635d9b..ead5451 100644 --- a/src/main/include/subsystems/ShooterSubsystem.h +++ b/src/main/include/subsystems/ShooterSubsystem.h @@ -166,6 +166,8 @@ class ShooterSubsystem : public frc2::SubsystemBase { nt->GetDoubleTopic("BottomWheelSetpointRPM").Publish()}; nt::BooleanPublisher isUpToSpeedPub{ nt->GetBooleanTopic("IsUpToSpeed").Publish()}; + nt::DoubleEntry topWheelTuningSetpoint{nt->GetDoubleTopic("TopWheelTuningSetpoint").GetEntry(0)}; + nt::DoubleEntry bottomWheelTuningSetpoint{nt->GetDoubleTopic("BottomWheelTuningSetpoint").GetEntry(0)}; units::turns_per_second_t topWheelVelocitySetpoint{0_rpm}; units::turns_per_second_t bottomWheelVelocitySetpoint{0_rpm};