|
YAMS
Yet Another Mechanism System
|
#include <DerivativeTimeFilter.hpp>
Public Member Functions | |
| DerivativeTimeFilter (double initial, wpi::units::second_t debouncerPeriod) | |
| DerivativeTimeFilter (wpi::units::second_t debouncerPeriod) | |
| double | Derivative (double current, wpi::units::second_t dt) |
| double | Derivative (double current) |
Computes the time-derivative of a scalar value, debounced to avoid updating too frequently.
The derivative is computed over the elapsed FPGA time between calls and is gated by a configurable debounce period so high-frequency callers still receive stable readings.
| yams::math::DerivativeTimeFilter::DerivativeTimeFilter | ( | double | initial, |
| wpi::units::second_t | debouncerPeriod | ||
| ) |
Create a derivative filter with a known initial value.
The initial value is timestamped at the time of construction.
| initial | Initial value to differentiate from. |
| debouncerPeriod | Minimum period between derivative updates. |
|
explicit |
Create a derivative filter with no initial value (starts from 0).
| debouncerPeriod | Minimum period between derivative updates. |
| double yams::math::DerivativeTimeFilter::Derivative | ( | double | current | ) |
Get the derivative of the current value over the time elapsed since the last call.
If the debounce period has not elapsed, returns the cached result.
| current | Current value. |
| double yams::math::DerivativeTimeFilter::Derivative | ( | double | current, |
| wpi::units::second_t | dt | ||
| ) |
Get the derivative of the current value over a specified delta time.
If the debounce period has not elapsed, returns the cached result.
| current | Current value. |
| dt | Delta time to use as the denominator. |