10 #include <wpi/mutex.h>
11 #include <wpi/raw_ostream.h>
13 #include "frc/ErrorBase.h"
14 #include "frc/Timer.h"
95 virtual void StopMotor() = 0;
99 static constexpr
double kDefaultSafetyExpiration = 0.1;
102 double m_expiration = kDefaultSafetyExpiration;
105 bool m_enabled =
false;
110 mutable wpi::mutex m_thisMutex;
double GetExpiration() const
Retrieve the timeout value for the corresponding motor safety object.
static void CheckMotors()
Check the motors to see if any have timed out.
bool IsAlive() const
Determine if the motor is still operating or has timed out.
void Feed()
Feed the motor safety object.
This base class runs a watchdog timer and calls the subclass's StopMotor() function if the timeout ex...
Definition: MotorSafety.h:24
void SetSafetyEnabled(bool enabled)
Enable/disable motor safety for this device.
void SetExpiration(double expirationTime)
Set the expiration time for the corresponding motor safety object.
Base class for most objects.
Definition: ErrorBase.h:104
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:47
static double GetFPGATimestamp()
Return the FPGA system clock time in seconds.
void Check()
Check if this motor has exceeded its timeout.
bool IsSafetyEnabled() const
Return the state of the motor safety enabled flag.