[wpilib] Rename MotorController setDutyCycle() to setThrottle() (#8720)

Fixes #8716.
This commit is contained in:
Tyler Veness
2026-04-09 22:28:01 -07:00
committed by GitHub
parent a4e035ba64
commit b6849a8da3
160 changed files with 659 additions and 706 deletions

View File

@@ -142,7 +142,7 @@ class ArmSimulationTest {
// advance 75 timesteps
SimHooks.stepTiming(3.5);
assertEquals(0.0, m_motorSim.getDutyCycle(), 0.01);
assertEquals(0.0, m_motorSim.getThrottle(), 0.01);
assertEquals(Constants.kMinAngleRads, m_encoderSim.getDistance(), 2.0);
}
}

View File

@@ -131,7 +131,7 @@ class ElevatorSimulationTest {
// advance 75 timesteps
SimHooks.stepTiming(1.5);
assertEquals(0.0, m_motorSim.getDutyCycle(), 0.05);
assertEquals(0.0, m_motorSim.getThrottle(), 0.05);
assertEquals(0.0, m_encoderSim.getDistance(), 0.05);
}
}

View File

@@ -47,14 +47,14 @@ class IntakeTest {
m_intake.retract(); // close the intake
m_intake.activate(0.5); // try to activate the motor
assertEquals(
0.0, m_simMotor.getDutyCycle(), DELTA); // make sure that the value set to the motor is 0
0.0, m_simMotor.getThrottle(), DELTA); // make sure that the value set to the motor is 0
}
@Test
void worksWhenOpen() {
m_intake.deploy();
m_intake.activate(0.5);
assertEquals(0.5, m_simMotor.getDutyCycle(), DELTA);
assertEquals(0.5, m_simMotor.getThrottle(), DELTA);
}
@Test