![]() |
WPILibC++ 2027.0.0-alpha-4
|
REV Robotics SPARK Motor Controller with PWM control. More...
#include <wpi/hardware/motor/Spark.hpp>
Public Member Functions | |
| Spark (int channel) | |
| Constructor for a SPARK connected via PWM. | |
| Spark (Spark &&)=default | |
| Spark & | operator= (Spark &&)=default |
| Public Member Functions inherited from wpi::PWMMotorController | |
| PWMMotorController (PWMMotorController &&)=default | |
| PWMMotorController & | operator= (PWMMotorController &&)=default |
| void | SetDutyCycle (double dutyCycle) override |
| Sets the duty cycle of the motor controller. | |
| double | GetDutyCycle () const override |
| Gets the duty cycle of the motor controller. | |
| virtual wpi::units::volt_t | GetVoltage () const |
| Gets the voltage output of the motor controller, nominally between -12 V and 12 V. | |
| void | SetInverted (bool isInverted) override |
| Sets the inversion state of the motor controller. | |
| bool | GetInverted () const override |
| Gets the inversion state of the motor controller. | |
| void | Disable () override |
| Disables the motor controller. | |
| void | StopMotor () override |
| Called to stop the motor when the timeout expires. | |
| std::string | GetDescription () const override |
| Returns a description to print when an error occurs. | |
| int | GetChannel () const |
| void | EnableDeadbandElimination (bool eliminateDeadband) |
| Optionally eliminate the deadband from a motor controller. | |
| void | AddFollower (PWMMotorController &follower) |
| Make the given PWM motor controller follow the output of this one. | |
| template<std::derived_from< PWMMotorController > T> | |
| void | AddFollower (T &&follower) |
| Make the given PWM motor controller follow the output of this one. | |
| Public Member Functions inherited from wpi::MotorController | |
| virtual | ~MotorController ()=default |
| virtual void | SetVoltage (wpi::units::volt_t voltage) |
| Sets the voltage output of the motor controller. | |
| Public Member Functions inherited from wpi::MotorSafety | |
| MotorSafety () | |
| virtual | ~MotorSafety () |
| MotorSafety (MotorSafety &&rhs) | |
| MotorSafety & | operator= (MotorSafety &&rhs) |
| void | Feed () |
| Feed the motor safety object. | |
| void | SetExpiration (wpi::units::second_t expirationTime) |
| Set the expiration time for the corresponding motor safety object. | |
| wpi::units::second_t | GetExpiration () const |
| Retrieve the timeout value for the corresponding motor safety object. | |
| bool | IsAlive () const |
| Determine if the motor is still operating or has timed out. | |
| void | SetSafetyEnabled (bool enabled) |
| Enable/disable motor safety for this device. | |
| bool | IsSafetyEnabled () const |
| Return the state of the motor safety enabled flag. | |
| void | Check () |
| Check if this motor has exceeded its timeout. | |
| Public Member Functions inherited from wpi::util::Sendable | |
| virtual constexpr | ~Sendable ()=default |
| Public Member Functions inherited from wpi::util::SendableHelper< PWMMotorController > | |
| constexpr | SendableHelper (const SendableHelper &rhs)=default |
| constexpr SendableHelper & | operator= (const SendableHelper &rhs)=default |
Additional Inherited Members | |
| Static Public Member Functions inherited from wpi::MotorSafety | |
| static void | CheckMotors () |
| Check the motors to see if any have timed out. | |
| Protected Member Functions inherited from wpi::PWMMotorController | |
| PWMMotorController (std::string_view name, int channel) | |
| Constructor for a PWM Motor Controller connected via PWM. | |
| void | InitSendable (wpi::util::SendableBuilder &builder) override |
| Initializes this Sendable object. | |
| void | SetDutyCycleInternal (double dutyCycle) |
| double | GetDutyCycleInternal () const |
| void | SetBounds (wpi::units::microsecond_t maxPwm, wpi::units::microsecond_t deadbandMaxPwm, wpi::units::microsecond_t centerPwm, wpi::units::microsecond_t deadbandMinPwm, wpi::units::microsecond_t minPwm) |
| Protected Member Functions inherited from wpi::util::SendableHelper< PWMMotorController > | |
| constexpr | ~SendableHelper () |
| Protected Attributes inherited from wpi::PWMMotorController | |
| PWM | m_pwm |
| PWM instances for motor controller. | |
REV Robotics SPARK Motor Controller with PWM control.
Note that the SPARK uses the following bounds for PWM values. These values should work reasonably well for most controllers, but if users experience issues such as asymmetric behavior around the deadband or inability to saturate the controller in either direction, calibration is recommended. The calibration procedure can be found in the SPARK User Manual available from REV Robotics.
|
explicit |
|
default |