10#include "wpi/units/time.hpp"
108 static constexpr auto kDefaultSafetyExpiration = 100_ms;
111 wpi::units::second_t m_expiration = kDefaultSafetyExpiration;
114 bool m_enabled =
false;
void Feed()
Feed the motor safety object.
void SetExpiration(wpi::units::second_t expirationTime)
Set the expiration time for the corresponding motor safety object.
bool IsAlive() const
Determine if the motor is still operating or has timed out.
static void CheckMotors()
Check the motors to see if any have timed out.
wpi::units::second_t GetExpiration() const
Retrieve the timeout value for the corresponding motor safety object.
virtual void StopMotor()=0
Called to stop the motor when the timeout expires.
bool IsSafetyEnabled() const
Return the state of the motor safety enabled flag.
MotorSafety & operator=(MotorSafety &&rhs)
MotorSafety(MotorSafety &&rhs)
void Check()
Check if this motor has exceeded its timeout.
void SetSafetyEnabled(bool enabled)
Enable/disable motor safety for this device.
virtual std::string GetDescription() const =0
Returns a description to print when an error occurs.
static wpi::units::second_t GetFPGATimestamp()
Return the FPGA system clock time in seconds.
::std::mutex mutex
Definition mutex.hpp:17
Definition CvSource.hpp:15