|
| | DebounceSensor () |
| | Construct a new DebounceSensor object.
|
| void | SetEdgeCallback (std::function< void()> lambda) |
| | Set a callback function for detecting any edge (rising or falling).
|
| void | SetRisingEdgeCallback (std::function< void()> lambda) |
| | Set a callback function for detecting a rising edge.
|
| void | SetFallingEdgeCallback (std::function< void()> lambda) |
| | Set a callback function for detecting a falling edge.
|
| virtual void | Reset () |
| | Reset the sensor state.
|
| void | SetGetter (std::function< bool()> _lambda) |
| | Set the lambda function to fetch sensor data.
|
| void | ApplyPostProcessing (std::function< bool(bool)> func) |
| | Set a post-processing function for sensor data.
|
| bool | Get () const |
| | Get the current sensor state.
|
| void | Refresh () override |
| | Refresh the sensor state.
|
| | Loggable (std::string_view name) |
| | Construct a Loggable that registers a top-level table name.
|
| | Loggable (std::shared_ptr< nt::NetworkTable > table) |
| | Construct a Loggable that uses an existing NetworkTable.
|
| | Loggable () |
| | Default construct an uninitialized Loggable.
|
| void | LogChild (std::string_view name, Loggable *child) |
| | Register a child Loggable under a named subtree.
|
| void | LogChild (std::string_view name, wpi::Sendable *child) |
| | Register a child Sendable under a named subtree.
|
| void | SetPeriodicLevel (LogLevel level) |
| | Set the logging level for LoggablePeriodic.
|
| template<typename T> |
| T | WriteLog (std::string_view field, const T &data, LogLevel level=LogLevel::Normal) |
| | Publish a value to NetworkTables under the given field.
|
| template<typename T> |
| T | ReadLog (std::string_view field, const T &defaultValue={}) |
| | Read a value from NetworkTables for the given field.
|
|
template<> |
| decltype(Loggable::subscribers) ::iterator | addSubscriber (std::string_view field, const std::vector< bool > &defaultValue) |
|
template<> |
| void | WriteLogImpl (nt::Publisher *pub, const std::vector< bool > &data) |
|
template<> |
| std::vector< bool > | ReadLogImpl (nt::Subscriber *sub) |
Sensor for debouncing and detecting rising/falling edges of boolean inputs.
This class filters out noise in boolean inputs and detects edges (state changes).
- A rising edge occurs when the input changes from false to true.
- A falling edge occurs when the input changes from true to false.
Debouncing ensures that rapid state changes are treated as a single edge.