mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31:43 +00:00
[glass, wpilib] Replace remaining references to Speed Controller with Motor Controller (#4769)
This commit is contained in:
@@ -20,7 +20,7 @@ static constexpr const char* widgetStrings[] = {
|
||||
"ComboBox Chooser",
|
||||
"Split Button Chooser",
|
||||
"Encoder",
|
||||
"Speed Controller",
|
||||
"Motor Controller",
|
||||
"Command",
|
||||
"PID Command",
|
||||
"PID Controller",
|
||||
|
||||
@@ -166,7 +166,7 @@ class PWM : public wpi::Sendable, public wpi::SendableHelper<PWM> {
|
||||
/**
|
||||
* Optionally eliminate the deadband from a motor controller.
|
||||
*
|
||||
* @param eliminateDeadband If true, set the motor curve on the speed
|
||||
* @param eliminateDeadband If true, set the motor curve on the motor
|
||||
* controller to eliminate the deadband in the middle
|
||||
* of the range. Otherwise, keep the full range
|
||||
* without modifying any values.
|
||||
|
||||
@@ -23,7 +23,7 @@ class MotorController {
|
||||
virtual void Set(double speed) = 0;
|
||||
|
||||
/**
|
||||
* Sets the voltage output of the SpeedController. Compensates for
|
||||
* Sets the voltage output of the MotorController. Compensates for
|
||||
* the current bus voltage to ensure that the desired voltage is output even
|
||||
* if the battery voltage is below 12V - highly useful when the voltage
|
||||
* outputs are "meaningful" (e.g. they come from a feedforward calculation).
|
||||
|
||||
@@ -64,7 +64,7 @@ class PWMMotorController : public MotorController,
|
||||
/**
|
||||
* Optionally eliminate the deadband from a motor controller.
|
||||
*
|
||||
* @param eliminateDeadband If true, set the motor curve on the speed
|
||||
* @param eliminateDeadband If true, set the motor curve on the motor
|
||||
* controller to eliminate the deadband in the middle
|
||||
* of the range. Otherwise, keep the full range
|
||||
* without modifying any values.
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace frc {
|
||||
class ShuffleboardContainer;
|
||||
|
||||
/**
|
||||
* A Shuffleboard widget that handles a Sendable object such as a speed
|
||||
* A Shuffleboard widget that handles a Sendable object such as a motor
|
||||
* controller or sensor.
|
||||
*/
|
||||
class ComplexWidget final : public ShuffleboardWidget<ComplexWidget> {
|
||||
|
||||
@@ -18,13 +18,13 @@ std::ostream& operator<<(std::ostream& os,
|
||||
const MotorControllerGroupTestType& type) {
|
||||
switch (type) {
|
||||
case TEST_ONE:
|
||||
os << "MotorControllerGroup with one speed controller";
|
||||
os << "MotorControllerGroup with one motor controller";
|
||||
break;
|
||||
case TEST_TWO:
|
||||
os << "MotorControllerGroup with two speed controllers";
|
||||
os << "MotorControllerGroup with two motor controllers";
|
||||
break;
|
||||
case TEST_THREE:
|
||||
os << "MotorControllerGroup with three speed controllers";
|
||||
os << "MotorControllerGroup with three motor controllers";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -37,32 +37,32 @@ std::ostream& operator<<(std::ostream& os,
|
||||
class MotorControllerGroupTest
|
||||
: public testing::TestWithParam<MotorControllerGroupTestType> {
|
||||
protected:
|
||||
std::vector<MockMotorController> m_speedControllers;
|
||||
std::vector<MockMotorController> m_motorControllers;
|
||||
std::unique_ptr<MotorControllerGroup> m_group;
|
||||
|
||||
void SetUp() override {
|
||||
switch (GetParam()) {
|
||||
case TEST_ONE: {
|
||||
m_speedControllers.emplace_back();
|
||||
m_group = std::make_unique<MotorControllerGroup>(m_speedControllers[0]);
|
||||
m_motorControllers.emplace_back();
|
||||
m_group = std::make_unique<MotorControllerGroup>(m_motorControllers[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
case TEST_TWO: {
|
||||
m_speedControllers.emplace_back();
|
||||
m_speedControllers.emplace_back();
|
||||
m_group = std::make_unique<MotorControllerGroup>(m_speedControllers[0],
|
||||
m_speedControllers[1]);
|
||||
m_motorControllers.emplace_back();
|
||||
m_motorControllers.emplace_back();
|
||||
m_group = std::make_unique<MotorControllerGroup>(m_motorControllers[0],
|
||||
m_motorControllers[1]);
|
||||
break;
|
||||
}
|
||||
|
||||
case TEST_THREE: {
|
||||
m_speedControllers.emplace_back();
|
||||
m_speedControllers.emplace_back();
|
||||
m_speedControllers.emplace_back();
|
||||
m_group = std::make_unique<MotorControllerGroup>(m_speedControllers[0],
|
||||
m_speedControllers[1],
|
||||
m_speedControllers[2]);
|
||||
m_motorControllers.emplace_back();
|
||||
m_motorControllers.emplace_back();
|
||||
m_motorControllers.emplace_back();
|
||||
m_group = std::make_unique<MotorControllerGroup>(m_motorControllers[0],
|
||||
m_motorControllers[1],
|
||||
m_motorControllers[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -72,8 +72,8 @@ class MotorControllerGroupTest
|
||||
TEST_P(MotorControllerGroupTest, Set) {
|
||||
m_group->Set(1.0);
|
||||
|
||||
for (auto& speedController : m_speedControllers) {
|
||||
EXPECT_FLOAT_EQ(speedController.Get(), 1.0);
|
||||
for (auto& motorController : m_motorControllers) {
|
||||
EXPECT_FLOAT_EQ(motorController.Get(), 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,13 +84,13 @@ TEST_P(MotorControllerGroupTest, GetInverted) {
|
||||
}
|
||||
|
||||
TEST_P(MotorControllerGroupTest, SetInvertedDoesNotModifyMotorControllers) {
|
||||
for (auto& speedController : m_speedControllers) {
|
||||
speedController.SetInverted(false);
|
||||
for (auto& motorController : m_motorControllers) {
|
||||
motorController.SetInverted(false);
|
||||
}
|
||||
m_group->SetInverted(true);
|
||||
|
||||
for (auto& speedController : m_speedControllers) {
|
||||
EXPECT_EQ(speedController.GetInverted(), false);
|
||||
for (auto& motorController : m_motorControllers) {
|
||||
EXPECT_EQ(motorController.GetInverted(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,8 +98,8 @@ TEST_P(MotorControllerGroupTest, SetInvertedDoesInvert) {
|
||||
m_group->SetInverted(true);
|
||||
m_group->Set(1.0);
|
||||
|
||||
for (auto& speedController : m_speedControllers) {
|
||||
EXPECT_FLOAT_EQ(speedController.Get(), -1.0);
|
||||
for (auto& motorController : m_motorControllers) {
|
||||
EXPECT_FLOAT_EQ(motorController.Get(), -1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ TEST_P(MotorControllerGroupTest, Disable) {
|
||||
m_group->Set(1.0);
|
||||
m_group->Disable();
|
||||
|
||||
for (auto& speedController : m_speedControllers) {
|
||||
EXPECT_FLOAT_EQ(speedController.Get(), 0.0);
|
||||
for (auto& motorController : m_motorControllers) {
|
||||
EXPECT_FLOAT_EQ(motorController.Get(), 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,8 +116,8 @@ TEST_P(MotorControllerGroupTest, StopMotor) {
|
||||
m_group->Set(1.0);
|
||||
m_group->StopMotor();
|
||||
|
||||
for (auto& speedController : m_speedControllers) {
|
||||
EXPECT_FLOAT_EQ(speedController.Get(), 0.0);
|
||||
for (auto& motorController : m_motorControllers) {
|
||||
EXPECT_FLOAT_EQ(motorController.Get(), 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user