Class SetpointContinuousJamChecker

Class Documentation

class SetpointContinuousJamChecker

A functor (function object) to be used for setpoint subsystem jam detection.

Uses a conditional timeout to continuously check if the subsystem’s current position is within an acceptable range of the desired position. If it is outside of the acceptable range for too long then the timeout times out and the subsystem is considered jammed.

Public Functions

inline SetpointContinuousJamChecker(SetpointSubsystem *setpointSubsystem, float distanceTolerance, uint32_t temporalTolerance)
Parameters:
  • setpointSubsystem[in] the setpoint subsystem to do jam checking on.

  • distanceTolerance[in] the acceptable distance between the setpoint and current position.

  • temporalTolerance[in] the maximum amount of time the distance can be greater than the distance tolerance before the system is considered jammed.

inline void restart()

Resets the jam timer

inline bool check()

Update subsystem jam detection and check whether subsystem is jammed. If subsystem is within distance tolerance of desired value then timer is reset, even if at the time of call it would have expired, as being within tolerance is checked first.

Note

Should be called once per subsystem refresh (it’s like an execute)

Returns:

true if subsystem is jammed, false otherwise

inline float getJamSetpointTolerance() const
Returns:

the jamming distance tolerance of this jam checker