50 void Set(
double value)
override;
73 double Get()
const override;
118 template <std::derived_from<PWMMotorController> T>
120 m_owningFollowers.emplace_back(
121 std::make_unique<std::decay_t<T>>(std::forward<T>(follower)));
140 bool m_isInverted =
false;
141 std::vector<PWMMotorController*> m_nonowningFollowers;
142 std::vector<std::unique_ptr<PWMMotorController>> m_owningFollowers;
Class for configuring Direct Memory Access (DMA) of FPGA inputs.
Definition DMA.h:23
Interface for motor controlling devices.
Definition MotorController.h:14
The Motor Safety feature acts as a watchdog timer for an individual motor.
Definition MotorSafety.h:25
Class implements the PWM generation in the FPGA.
Definition PWM.h:27
Common base class for all PWM Motor Controllers.
Definition PWMMotorController.h:35
void Disable() override
Common interface for disabling a motor.
void AddFollower(T &&follower)
Make the given PWM motor controller follow the output of this one.
Definition PWMMotorController.h:119
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
PWMMotorController(std::string_view name, int channel)
Constructor for a PWM Motor Controller connected via PWM.
bool GetInverted() const override
Common interface for returning the inversion state of a motor controller.
PWMMotorController & operator=(PWMMotorController &&)=default
void StopMotor() override
Common interface to stop the motor until Set is called again.
PWM m_pwm
PWM instances for motor controller.
Definition PWMMotorController.h:137
void SetVoltage(units::volt_t output) override
Sets the voltage output of the PWMMotorController.
virtual units::volt_t GetVoltage() const
Gets the voltage output of the motor controller, nominally between -12 V and 12 V.
void Set(double value) override
Set the PWM value.
double Get() const override
Get the recently set value of the PWM.
PWMMotorController(PWMMotorController &&)=default
std::string GetDescription() const override
Returns a description to print when an error occurs.
void AddFollower(PWMMotorController &follower)
Make the given PWM motor controller follow the output of this one.
void EnableDeadbandElimination(bool eliminateDeadband)
Optionally eliminate the deadband from a motor controller.
void SetInverted(bool isInverted) override
Common interface for inverting direction of a motor controller.
Helper class for building Sendable dashboard representations.
Definition SendableBuilder.h:21
A helper class for use with objects that add themselves to SendableRegistry.
Definition SendableHelper.h:21
Interface for Sendable objects.
Definition Sendable.h:16
#define WPI_IGNORE_DEPRECATED
Definition deprecated.h:16
#define WPI_UNIGNORE_DEPRECATED
Definition deprecated.h:27