WPILibC++ 2023.4.3-108-ge5452e3
|
Allows multiple MotorController objects to be linked together. More...
#include <frc/motorcontrol/MotorControllerGroup.h>
Public Member Functions | |
template<class... MotorControllers> | |
MotorControllerGroup (MotorController &motorController, MotorControllers &... motorControllers) | |
MotorControllerGroup (std::vector< std::reference_wrapper< MotorController > > &&motorControllers) | |
MotorControllerGroup (MotorControllerGroup &&)=default | |
MotorControllerGroup & | operator= (MotorControllerGroup &&)=default |
void | Set (double speed) override |
Common interface for setting the speed of a motor controller. More... | |
void | SetVoltage (units::volt_t output) override |
Sets the voltage output of the MotorController. More... | |
double | Get () const override |
Common interface for getting the current set speed of a motor controller. More... | |
void | SetInverted (bool isInverted) override |
Common interface for inverting direction of a motor controller. More... | |
bool | GetInverted () const override |
Common interface for returning the inversion state of a motor controller. More... | |
void | Disable () override |
Common interface for disabling a motor. More... | |
void | StopMotor () override |
Common interface to stop the motor until Set is called again. More... | |
void | InitSendable (wpi::SendableBuilder &builder) override |
Initializes this Sendable object. More... | |
Public Member Functions inherited from wpi::Sendable | |
virtual | ~Sendable ()=default |
virtual void | InitSendable (SendableBuilder &builder)=0 |
Initializes this Sendable object. More... | |
Public Member Functions inherited from frc::MotorController | |
virtual | ~MotorController ()=default |
virtual void | Set (double speed)=0 |
Common interface for setting the speed of a motor controller. More... | |
virtual void | SetVoltage (units::volt_t output) |
Sets the voltage output of the MotorController. More... | |
virtual double | Get () const =0 |
Common interface for getting the current set speed of a motor controller. More... | |
virtual void | SetInverted (bool isInverted)=0 |
Common interface for inverting direction of a motor controller. More... | |
virtual bool | GetInverted () const =0 |
Common interface for returning the inversion state of a motor controller. More... | |
virtual void | Disable ()=0 |
Common interface for disabling a motor. More... | |
virtual void | StopMotor ()=0 |
Common interface to stop the motor until Set is called again. More... | |
Public Member Functions inherited from wpi::SendableHelper< MotorControllerGroup > | |
SendableHelper (const SendableHelper &rhs)=default | |
SendableHelper (SendableHelper &&rhs) | |
SendableHelper & | operator= (const SendableHelper &rhs)=default |
SendableHelper & | operator= (SendableHelper &&rhs) |
Additional Inherited Members | |
Protected Member Functions inherited from wpi::SendableHelper< MotorControllerGroup > | |
SendableHelper ()=default | |
~SendableHelper () | |
Allows multiple MotorController objects to be linked together.
|
explicit |
|
explicit |
|
default |
|
overridevirtual |
Common interface for disabling a motor.
Implements frc::MotorController.
|
overridevirtual |
Common interface for getting the current set speed of a motor controller.
Implements frc::MotorController.
|
overridevirtual |
Common interface for returning the inversion state of a motor controller.
Implements frc::MotorController.
|
overridevirtual |
|
default |
|
overridevirtual |
Common interface for setting the speed of a motor controller.
speed | The speed to set. Value should be between -1.0 and 1.0. |
Implements frc::MotorController.
|
overridevirtual |
Common interface for inverting direction of a motor controller.
isInverted | The state of inversion, true is inverted. |
Implements frc::MotorController.
|
overridevirtual |
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).
NOTE: This function must be called regularly in order for voltage compensation to work properly - unlike the ordinary set function, it is not "set it and forget it."
output | The voltage to output. |
Reimplemented from frc::MotorController.
|
overridevirtual |
Common interface to stop the motor until Set is called again.
Implements frc::MotorController.