From 3cae4b322d46617eed4902a4e4f63b17d34bb59a Mon Sep 17 00:00:00 2001 From: Drew Williams Date: Tue, 3 Sep 2024 10:25:14 -0400 Subject: [PATCH] change sim gear ratio --- src/main/cpp/subsystems/IntakeSubsystem.cpp | 2 +- src/main/cpp/subsystems/ShooterSubsystem.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/cpp/subsystems/IntakeSubsystem.cpp b/src/main/cpp/subsystems/IntakeSubsystem.cpp index c79414b..357b8ef 100644 --- a/src/main/cpp/subsystems/IntakeSubsystem.cpp +++ b/src/main/cpp/subsystems/IntakeSubsystem.cpp @@ -62,7 +62,7 @@ void IntakeSubsystem::SimulationPeriodic() { intakeMotorSim.SetSupplyVoltage(frc::RobotController::GetBatteryVoltage()); intakeSim.SetInputVoltage(intakeMotorSim.GetMotorVoltage()); intakeSim.Update(consts::LOOP_PERIOD); - intakeMotorSim.SetRotorVelocity(intakeSim.GetAngularVelocity()); + intakeMotorSim.SetRotorVelocity(intakeSim.GetAngularVelocity() * consts::intake::physical::INTAKE_RATIO); } bool IntakeSubsystem::ConfigureIntakeMotor(bool invert, diff --git a/src/main/cpp/subsystems/ShooterSubsystem.cpp b/src/main/cpp/subsystems/ShooterSubsystem.cpp index 0b3b6a0..a11b727 100644 --- a/src/main/cpp/subsystems/ShooterSubsystem.cpp +++ b/src/main/cpp/subsystems/ShooterSubsystem.cpp @@ -93,8 +93,8 @@ void ShooterSubsystem::SimulationPeriodic() { topFlywheelSim.Update(consts::LOOP_PERIOD); bottomFlywheelSim.Update(consts::LOOP_PERIOD); - topMotorSim.SetRotorVelocity(topFlywheelSim.GetAngularVelocity()); - bottomMotorSim.SetRotorVelocity(bottomFlywheelSim.GetAngularVelocity()); + topMotorSim.SetRotorVelocity(topFlywheelSim.GetAngularVelocity() * consts::shooter::physical::SHOOTER_RATIO); + bottomMotorSim.SetRotorVelocity(bottomFlywheelSim.GetAngularVelocity() * consts::shooter::physical::SHOOTER_RATIO); } void ShooterSubsystem::UpdateNTEntries() {