mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpilib] MotorControllerGroup: Override setVoltage (#4403)
This causes setVoltage to be called on the lower level motor contollers, which is benefical in cases when they are smart motor controllers. Previously, the default implementation (using the bus voltage and calling set()) was used in this case. This does slightly pessimize the case when the lower level motor controllers use the default setVoltage implementation, but given the prevalence of smart motor controllers, this seems like an overall win.
This commit is contained in:
@@ -31,6 +31,7 @@ class MotorControllerGroup : public wpi::Sendable,
|
||||
MotorControllerGroup& operator=(MotorControllerGroup&&) = default;
|
||||
|
||||
void Set(double speed) override;
|
||||
void SetVoltage(units::volt_t output) override;
|
||||
double Get() const override;
|
||||
void SetInverted(bool isInverted) override;
|
||||
bool GetInverted() const override;
|
||||
|
||||
Reference in New Issue
Block a user