2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
argos_lib::HysteresisFilter< T > Class Template Reference

A simple hysteresis filter for giving a bool output for a threshold. More...

#include <hysteresis_filter.h>

Public Member Functions

 HysteresisFilter ()=delete
 
 HysteresisFilter (T deactivateThreshold, T activateThreshold)
 Construct a new Hysteresis Filter object.
 
bool operator() (T newValue)
 Gets new status after applying hysteresis.
 

Private Attributes

const T m_activateThreshold
 Threshold above which output becomes true.
 
const T m_deactivateThreshold
 Threshold below which output becomes false.
 
bool m_currentState
 Latest state after applying hysteresis.
 

Detailed Description

template<typename T>
class argos_lib::HysteresisFilter< T >

A simple hysteresis filter for giving a bool output for a threshold.

Template Parameters
TType of threshold values

Constructor & Destructor Documentation

◆ HysteresisFilter() [1/2]

template<typename T >
argos_lib::HysteresisFilter< T >::HysteresisFilter ( )
delete

◆ HysteresisFilter() [2/2]

template<typename T >
argos_lib::HysteresisFilter< T >::HysteresisFilter ( deactivateThreshold,
activateThreshold 
)
inline

Construct a new Hysteresis Filter object.

Parameters
deactivateThresholdValue below which output becomes false
activateThresholdValue above which output becomes true

Member Function Documentation

◆ operator()()

template<typename T >
bool argos_lib::HysteresisFilter< T >::operator() ( newValue)
inline

Gets new status after applying hysteresis.

Parameters
newValueLatest raw value to update the filter
Returns
Filtered value after applying newValue

Member Data Documentation

◆ m_activateThreshold

template<typename T >
const T argos_lib::HysteresisFilter< T >::m_activateThreshold
private

Threshold above which output becomes true.

◆ m_currentState

template<typename T >
bool argos_lib::HysteresisFilter< T >::m_currentState
private

Latest state after applying hysteresis.

◆ m_deactivateThreshold

template<typename T >
const T argos_lib::HysteresisFilter< T >::m_deactivateThreshold
private

Threshold below which output becomes false.


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