109 static constexpr auto kDefaultSafetyExpiration = 100_ms;
112 units::second_t m_expiration = kDefaultSafetyExpiration;
115 bool m_enabled =
false;
The Motor Safety feature acts as a watchdog timer for an individual motor.
Definition: MotorSafety.h:25
virtual void StopMotor()=0
Called to stop the motor when the timeout expires.
void Check()
Check if this motor has exceeded its timeout.
units::second_t 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.
void SetExpiration(units::second_t expirationTime)
Set the expiration time for the corresponding motor safety object.
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.
void Feed()
Feed the motor safety object.
bool IsSafetyEnabled() const
Return the state of the motor safety enabled flag.
MotorSafety & operator=(MotorSafety &&rhs)
MotorSafety(MotorSafety &&rhs)
bool IsAlive() const
Determine if the motor is still operating or has timed out.
static units::second_t GetFPGATimestamp()
Return the FPGA system clock time in seconds.
Definition: AprilTagPoseEstimator.h:15
::std::mutex mutex
Definition: mutex.h:17