|
| RateLimiter (T min_value=std::numeric_limits< T >::quiet_NaN(), T max_value=std::numeric_limits< T >::quiet_NaN(), T min_first_derivative_neg=std::numeric_limits< T >::quiet_NaN(), T max_first_derivative_pos=std::numeric_limits< T >::quiet_NaN(), T min_first_derivative_pos=std::numeric_limits< T >::quiet_NaN(), T max_first_derivative_neg=std::numeric_limits< T >::quiet_NaN(), T min_second_derivative=std::numeric_limits< T >::quiet_NaN(), T max_second_derivative=std::numeric_limits< T >::quiet_NaN()) |
| Constructor.
|
|
T | limit (T &v, T v0, T v1, T dt) |
| Limit the value and first_derivative.
|
|
T | limit_value (T &v) |
| Limit the value.
|
|
T | limit_first_derivative (T &v, T v0, T dt) |
| Limit the first_derivative.
|
|
T | limit_second_derivative (T &v, T v0, T v1, T dt) |
| Limit the second_derivative.
|
|
void | set_params (T min_value=std::numeric_limits< T >::quiet_NaN(), T max_value=std::numeric_limits< T >::quiet_NaN(), T min_first_derivative_neg=std::numeric_limits< T >::quiet_NaN(), T max_first_derivative_pos=std::numeric_limits< T >::quiet_NaN(), T min_first_derivative_pos=std::numeric_limits< T >::quiet_NaN(), T max_first_derivative_neg=std::numeric_limits< T >::quiet_NaN(), T min_second_derivative=std::numeric_limits< T >::quiet_NaN(), T max_second_derivative=std::numeric_limits< T >::quiet_NaN()) |
| Set the parameters.
|
|
◆ RateLimiter()
template<typename T >
control_toolbox::RateLimiter< T >::RateLimiter |
( |
T |
min_value = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
max_value = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
min_first_derivative_neg = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
max_first_derivative_pos = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
min_first_derivative_pos = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
max_first_derivative_neg = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
min_second_derivative = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
max_second_derivative = std::numeric_limits<T>::quiet_NaN() |
|
) |
| |
Constructor.
- Parameters
-
[in] | min_value | Minimum value, e.g. [m/s], usually <= 0 |
[in] | max_value | Maximum value, e.g. [m/s], usually >= 0 |
[in] | min_first_derivative_neg | Minimum first_derivative, negative value, e.g. [m/s^2], usually <= 0 |
[in] | max_first_derivative_pos | Maximum first_derivative, positive value, e.g. [m/s^2], usually >= 0 |
[in] | min_first_derivative_pos | Asymmetric Minimum first_derivative, positive value, e.g. [m/s^2], usually <= 0 |
[in] | max_first_derivative_neg | Asymmetric Maximum first_derivative, negative value, e.g. [m/s^2], usually >= 0 |
[in] | min_second_derivative | Minimum second_derivative, e.g. [m/s^3], usually <= 0 |
[in] | max_second_derivative | Maximum second_derivative, e.g. [m/s^3], usually >= 0 |
- Note
- If max_* values are NAN, the respective limit is deactivated If min_* values are NAN (unspecified), defaults to -max If min_first_derivative_pos/max_first_derivative_neg values are NAN, symmetric limits are used
Disclaimer about the jerk limits: The jerk limit is only applied when accelerating or reverse_accelerating (i.e., "sign(jerk * accel) > 0"). This condition prevents oscillating closed-loop behavior, see discussion details in https://github.com/ros-controls/control_toolbox/issues/240. if you use this feature, you should perform a test to check that the behavior is really as you expect.
◆ limit()
Limit the value and first_derivative.
- Parameters
-
[in,out] | v | value, e.g. [m/s] |
[in] | v0 | Previous value to v , e.g. [m/s] |
[in] | v1 | Previous value to v0, e.g. [m/s] |
[in] | dt | Time step [s] |
- Returns
- Limiting factor (1.0 if none)
◆ limit_first_derivative()
Limit the first_derivative.
- Parameters
-
[in,out] | v | value, e.g. [m/s] |
[in] | v0 | Previous value, e.g. [m/s] |
[in] | dt | Time step [s] |
- Returns
- Limiting factor (1.0 if none)
◆ limit_second_derivative()
Limit the second_derivative.
- Parameters
-
[in,out] | v | value, e.g. [m/s] |
[in] | v0 | Previous value to v , e.g. [m/s] |
[in] | v1 | Previous value to v0, e.g. [m/s] |
[in] | dt | Time step [s] |
- Returns
- Limiting factor (1.0 if none)
- See also
- http://en.wikipedia.org/wiki/jerk_%28physics%29#Motion_control
- Note
- The jerk limit is only applied when accelerating or reverse_accelerating (i.e., "sign(jerk * accel) > 0").
◆ limit_value()
Limit the value.
- Parameters
-
[in,out] | v | value, e.g. [m/s] |
- Returns
- Limiting factor (1.0 if none)
◆ set_params()
template<typename T >
void control_toolbox::RateLimiter< T >::set_params |
( |
T |
min_value = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
max_value = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
min_first_derivative_neg = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
max_first_derivative_pos = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
min_first_derivative_pos = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
max_first_derivative_neg = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
min_second_derivative = std::numeric_limits<T>::quiet_NaN() , |
|
|
T |
max_second_derivative = std::numeric_limits<T>::quiet_NaN() |
|
) |
| |
Set the parameters.
- Parameters
-
[in] | min_value | Minimum value, e.g. [m/s], usually <= 0 |
[in] | max_value | Maximum value, e.g. [m/s], usually >= 0 |
[in] | min_first_derivative_neg | Minimum first_derivative, negative value, e.g. [m/s^2], usually <= 0 |
[in] | max_first_derivative_pos | Maximum first_derivative, positive value, e.g. [m/s^2], usually >= 0 |
[in] | min_first_derivative_pos | Asymmetric Minimum first_derivative, positive value, e.g. [m/s^2], usually <= 0 |
[in] | max_first_derivative_neg | Asymmetric Maximum first_derivative, negative value, e.g. [m/s^2], usually >= 0 |
[in] | min_second_derivative | Minimum second_derivative, e.g. [m/s^3], usually <= 0 |
[in] | max_second_derivative | Maximum second_derivative, e.g. [m/s^3], usually >= 0 |
- Note
- If max_* values are NAN, the respective limit is deactivated If min_* values are NAN (unspecified), defaults to -max If min_first_derivative_pos/max_first_derivative_neg values are NAN, symmetric limits are used
The documentation for this class was generated from the following file: