33 if constexpr (std::is_floating_point_v<T>) {
39 if (magnitude > deadband) {
40 if (maxMagnitude / deadband > 1.0E12) {
62 return maxMagnitude * (
value - deadband) / (maxMagnitude - deadband);
79 return maxMagnitude * (
value + deadband) / (maxMagnitude - deadband);
95 T modulus = maximumInput - minimumInput;
98 int numMax = (input - minimumInput) / modulus;
99 input -= numMax * modulus;
102 int numMin = (input - maximumInput) / modulus;
103 input -= numMin * modulus;
115 return InputModulus<units::radian_t>(angle,
#define WPILIB_DLLEXPORT
Definition: SymbolExports.h:36
typename std::enable_if< B, T >::type enable_if_t
Definition: core.h:298
UnitType abs(const UnitType x) noexcept
Compute absolute value.
Definition: math.h:721
Definition: AprilTagFieldLayout.h:22
WPILIB_DLLEXPORT constexpr units::radian_t AngleModulus(units::radian_t angle)
Wraps an angle to the range -pi to pi radians (-180 to 180 degrees).
Definition: MathUtil.h:114
T ApplyDeadband(T value, T deadband, T maxMagnitude=T{1.0})
Returns 0.0 if the given value is within the specified range around zero.
Definition: MathUtil.h:31
constexpr T InputModulus(T input, T minimumInput, T maximumInput)
Returns modulus of input.
Definition: MathUtil.h:94
static constexpr const unit_t< PI > pi(1)
Ratio of a circle's circumference to its diameter.
Traits which tests if a class is a unit
Definition: base.h:1864