Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
tap::control::setpoint::SetpointContinuousJamChecker Class Reference

#include <setpoint_continuous_jam_checker.hpp>

Public Member Functions

 SetpointContinuousJamChecker (SetpointSubsystem *setpointSubsystem, float distanceTolerance, uint32_t temporalTolerance)
 
void restart ()
 
bool check ()
 
float getJamSetpointTolerance () const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SetpointContinuousJamChecker()

tap::control::setpoint::SetpointContinuousJamChecker::SetpointContinuousJamChecker ( SetpointSubsystem setpointSubsystem,
float  distanceTolerance,
uint32_t  temporalTolerance 
)
inline
Parameters
[in]setpointSubsystemthe setpoint subsystem to do jam checking on.
[in]distanceTolerancethe acceptable distance between the setpoint and current position.
[in]temporalTolerancethe maximum amount of time the distance can be greater than the distance tolerance before the system is considered jammed.

Member Function Documentation

◆ check()

bool tap::control::setpoint::SetpointContinuousJamChecker::check ( )
inline

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

◆ getJamSetpointTolerance()

float tap::control::setpoint::SetpointContinuousJamChecker::getJamSetpointTolerance ( ) const
inline
Returns
the jamming distance tolerance of this jam checker

◆ restart()

void tap::control::setpoint::SetpointContinuousJamChecker::restart ( )
inline

Resets the jam timer


The documentation for this class was generated from the following file: