A class that limits the rate of change of an input value.
More...
#include <SlewRateLimiter.h>
|
| | SlewRateLimiter (Rate_t rateLimit, Unit_t initialValue=Unit_t{0}) |
| | Creates a new SlewRateLimiter with the given rate limit and initial value. More...
|
| |
| Unit_t | Calculate (Unit_t input) |
| | Filters the input to limit its slew rate. More...
|
| |
| void | Reset (Unit_t value) |
| | Resets the slew rate limiter to the specified value; ignores the rate limit when doing so. More...
|
| |
template<class Unit>
class frc::SlewRateLimiter< Unit >
A class that limits the rate of change of an input value.
Useful for implementing voltage, setpoint, and/or output ramps. A slew-rate limit is most appropriate when the quantity being controlled is a velocity or a voltage; when controlling a position, consider using a TrapezoidProfile instead.
- See also
- TrapezoidProfile
◆ SlewRateLimiter()
Creates a new SlewRateLimiter with the given rate limit and initial value.
- Parameters
-
| rateLimit | The rate-of-change limit. |
| initialValue | The initial value of the input. |
◆ Calculate()
Filters the input to limit its slew rate.
- Parameters
-
| input | The input value whose slew rate is to be limited. |
- Returns
- The filtered value, which will not change faster than the slew rate.
◆ Reset()
Resets the slew rate limiter to the specified value; ignores the rate limit when doing so.
- Parameters
-
| value | The value to reset to. |
The documentation for this class was generated from the following file: