[wpilibc] Fix compilation failure (#8431)

This commit is contained in:
Tyler Veness
2025-11-29 13:59:29 -08:00
committed by GitHub
parent 02c8d5c9db
commit 473f2a0aff
2 changed files with 6 additions and 6 deletions

View File

@@ -102,13 +102,13 @@ TEST(ElevatorSimTest, Stability) {
}
TEST(ElevatorSimTest, CurrentDraw) {
auto const motor = frc::DCMotor::KrakenX60(2);
frc::sim::ElevatorSim sim(motor, 20, 8_kg, 0.1_m, 0_m, 1_m, true, 0_m,
constexpr auto motor = wpi::math::DCMotor::KrakenX60(2);
wpi::sim::ElevatorSim sim(motor, 20, 8_kg, 0.1_m, 0_m, 1_m, true, 0_m,
{0.01, 0.0});
EXPECT_DOUBLE_EQ(0.0, sim.GetCurrentDraw().value());
sim.SetInputVoltage(motor.Voltage(motor.Torque(60_A), 0_rad_per_s));
sim.Update(100_ms);
// current draw should start at 60 A and decrease as the back emf catches up
// Current draw should start at 60 A and decrease as the back-EMF catches up
EXPECT_TRUE(0_A < sim.GetCurrentDraw() && sim.GetCurrentDraw() < 60_A);
}

View File

@@ -130,10 +130,10 @@ class ElevatorSimTest {
var motor = DCMotor.getKrakenX60(2);
var sim = new ElevatorSim(motor, 20, 8.0, 0.1, 0.0, 1.0, true, 0.0, 0.01, 0.0);
assertEquals(0.0, sim.getCurrentDrawAmps());
assertEquals(0.0, sim.getCurrentDraw());
sim.setInputVoltage(motor.getVoltage(motor.getTorque(60.0), 0.0));
sim.update(0.100);
// current draw should start at 60 A and decrease as the back emf catches up
assertTrue(0.0 < sim.getCurrentDrawAmps() && sim.getCurrentDrawAmps() < 60.0);
// Current draw should start at 60 A and decrease as the back-EMF catches up
assertTrue(0.0 < sim.getCurrentDraw() && sim.getCurrentDraw() < 60.0);
}
}