[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

@@ -134,7 +134,7 @@ TEST_P(ArmSimulationTest, Teleop) {
wpi::sim::StepTiming(3_s);
ASSERT_NEAR(0.0, m_motorSim.GetDutyCycle(), 0.05);
ASSERT_NEAR(0.0, m_motorSim.GetThrottle(), 0.05);
EXPECT_NEAR(kMinAngle.value(), m_encoderSim.GetDistance(), 2.0);
}
}

View File

@@ -118,7 +118,7 @@ TEST_F(ElevatorSimulationTest, Teleop) {
// advance 75 timesteps
wpi::sim::StepTiming(1.5_s);
ASSERT_NEAR(0.0, m_motorSim.GetDutyCycle(), 0.05);
ASSERT_NEAR(0.0, m_motorSim.GetThrottle(), 0.05);
ASSERT_NEAR(0.0, m_encoderSim.GetDistance(), 0.05);
}
}

View File

@@ -27,13 +27,13 @@ TEST_F(IntakeTest, DoesntWorkWhenClosed) {
EXPECT_DOUBLE_EQ(
0.0,
simMotor
.GetDutyCycle()); // make sure that the value set to the motor is 0
.GetThrottle()); // make sure that the value set to the motor is 0
}
TEST_F(IntakeTest, WorksWhenOpen) {
intake.Deploy();
intake.Activate(0.5);
EXPECT_DOUBLE_EQ(0.5, simMotor.GetDutyCycle());
EXPECT_DOUBLE_EQ(0.5, simMotor.GetThrottle());
}
TEST_F(IntakeTest, Retract) {